LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Bob Picco" <bob.picco@hp.com>
To: akpm@osdl.org
Cc: pj@sgi.com, bob.picco@hp.com, linux-kernel@vger.kernel.org
Subject: [PATCH] CPUSET related breakage of sys_mbind
Date: Mon, 15 Jan 2007 18:10:50 -0500	[thread overview]
Message-ID: <20070115231050.GA32220@localhost> (raw)


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 */
 

             reply	other threads:[~2007-01-15 23:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-15 23:10 Bob Picco [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070115231050.GA32220@localhost \
    --to=bob.picco@hp.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pj@sgi.com \
    --subject='Re: [PATCH] CPUSET related breakage of sys_mbind' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).