LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] CPUSET related breakage of sys_mbind
@ 2007-01-15 23:10 Bob Picco
  2007-01-16  2:43 ` Paul Jackson
  2007-01-16  4:46 ` Paul Jackson
  0 siblings, 2 replies; 6+ messages in thread
From: Bob Picco @ 2007-01-15 23:10 UTC (permalink / raw)
  To: akpm; +Cc: pj, bob.picco, linux-kernel


current->mems_allowed is defined for CONFIG_CPUSETS. This broke !CPUSETS
build. I compiled and linked tested both variants.

Signed-off-by: Bob Picco <bob.picco@hp.com>

 include/linux/cpuset.h |    6 ++++++
 mm/mempolicy.c         |    2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

Index: linux-2.6.20-rc4-mm1/mm/mempolicy.c
===================================================================
--- linux-2.6.20-rc4-mm1.orig/mm/mempolicy.c	2007-01-15 09:21:58.000000000 -0500
+++ linux-2.6.20-rc4-mm1/mm/mempolicy.c	2007-01-15 17:51:15.000000000 -0500
@@ -882,9 +882,9 @@ asmlinkage long sys_mbind(unsigned long 
 	int err;
 
 	err = get_nodes(&nodes, nmask, maxnode);
-	nodes_and(nodes, nodes, current->mems_allowed);
 	if (err)
 		return err;
+	cpuset_nodes_allowed(&nodes);
 	return do_mbind(start, len, mode, &nodes, flags);
 }
 
Index: linux-2.6.20-rc4-mm1/include/linux/cpuset.h
===================================================================
--- linux-2.6.20-rc4-mm1.orig/include/linux/cpuset.h	2007-01-15 09:21:32.000000000 -0500
+++ linux-2.6.20-rc4-mm1/include/linux/cpuset.h	2007-01-15 14:01:30.000000000 -0500
@@ -75,6 +75,11 @@ static inline int cpuset_do_slab_mem_spr
 
 extern void cpuset_track_online_nodes(void);
 
+static inline void cpuset_nodes_allowed(nodemask_t *nodes)
+{
+	nodes_and(*nodes, *nodes, current->mems_allowed);
+}
+
 #else /* !CONFIG_CPUSETS */
 
 static inline int cpuset_init_early(void) { return 0; }
@@ -145,6 +150,7 @@ static inline int cpuset_do_slab_mem_spr
 }
 
 static inline void cpuset_track_online_nodes(void) {}
+static inline void cpuset_nodes_allowed(nodemask_t *nodes) {}
 
 #endif /* !CONFIG_CPUSETS */
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] CPUSET related breakage of sys_mbind
  2007-01-15 23:10 [PATCH] CPUSET related breakage of sys_mbind Bob Picco
@ 2007-01-16  2:43 ` Paul Jackson
  2007-01-16  3:51   ` Christoph Lameter
  2007-01-16  4:46 ` Paul Jackson
  1 sibling, 1 reply; 6+ messages in thread
From: Paul Jackson @ 2007-01-16  2:43 UTC (permalink / raw)
  To: Bob Picco; +Cc: akpm, bob.picco, linux-kernel, clameter

You're right about this problemI think that Christoph Lameter
(added to cc list) is working on a fix for this.

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj@sgi.com> 1.925.600.0401

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] CPUSET related breakage of sys_mbind
  2007-01-16  2:43 ` Paul Jackson
@ 2007-01-16  3:51   ` Christoph Lameter
  2007-01-16  4:14     ` Paul Jackson
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Lameter @ 2007-01-16  3:51 UTC (permalink / raw)
  To: Paul Jackson; +Cc: Bob Picco, akpm, linux-kernel

On Mon, 15 Jan 2007, Paul Jackson wrote:

> You're right about this problemI think that Christoph Lameter
> (added to cc list) is working on a fix for this.

Cpusets is your thing so I think you could fix this the right way. There 
are already two different patches fixing this. Just make it the way that 
it fits cpusets.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] CPUSET related breakage of sys_mbind
  2007-01-16  3:51   ` Christoph Lameter
@ 2007-01-16  4:14     ` Paul Jackson
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Jackson @ 2007-01-16  4:14 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: bob.picco, akpm, linux-kernel

Christoph wrote:
> Cpusets is your thing so I think you could fix this the right way.

But wasn't it your patch that broke ...

Actually, I'd have blessed Bob Picco's patch, as it's done the right
way, with a cpuset_* macro hook, defined twice in cpuset.h, with and
without CONFIG_CPUSET, where the without case compiles to a no-op.
This is the same way as is used for the couple dozen other cpuset
kernel hooks.

But I thought you were already signed up for this one, so I didn't want
to trample on your efforts.

And, perhaps more important, I understood you had some other patches in
the works that have cpuset hooks.  I'm thinking it would be a good idea
to learn how these hooks are done, so we don't have to come around here
again.

How about this ... you take another look at Bob's patch.  If it's ok by
you too, then we can both bless it, and that should do it.

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj@sgi.com> 1.925.600.0401

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] CPUSET related breakage of sys_mbind
  2007-01-15 23:10 [PATCH] CPUSET related breakage of sys_mbind Bob Picco
  2007-01-16  2:43 ` Paul Jackson
@ 2007-01-16  4:46 ` Paul Jackson
  2007-01-16 19:48   ` Christoph Lameter
  1 sibling, 1 reply; 6+ messages in thread
From: Paul Jackson @ 2007-01-16  4:46 UTC (permalink / raw)
  To: Bob Picco; +Cc: akpm, bob.picco, linux-kernel

Patch looks good - thanks, Bob.

Signed-off-by: Paul Jackson <pj@sgi.com>

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj@sgi.com> 1.925.600.0401

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] CPUSET related breakage of sys_mbind
  2007-01-16  4:46 ` Paul Jackson
@ 2007-01-16 19:48   ` Christoph Lameter
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Lameter @ 2007-01-16 19:48 UTC (permalink / raw)
  To: Paul Jackson; +Cc: Bob Picco, akpm, linux-kernel

On Mon, 15 Jan 2007, Paul Jackson wrote:

> Patch looks good - thanks, Bob.
> 
> Signed-off-by: Paul Jackson <pj@sgi.com>

Looks good to me too.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-01-16 19:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-15 23:10 [PATCH] CPUSET related breakage of sys_mbind Bob Picco
2007-01-16  2:43 ` Paul Jackson
2007-01-16  3:51   ` Christoph Lameter
2007-01-16  4:14     ` Paul Jackson
2007-01-16  4:46 ` Paul Jackson
2007-01-16 19:48   ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).