linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: ak@suse.de
Cc: linux-mm@kvack.org, pj@sgi.com
Subject: [RFC] mbind: Restrict nodes to the currently allowed cpuset
Date: Thu, 4 Jan 2007 11:16:42 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0701041115220.22710@schroedinger.engr.sgi.com> (raw)

Currently one can specify an arbitrary node mask to mbind that includes nodes
not allowed. If that is done with an interleave policy then we will go around
all the nodes. Those outside of the currently allowed cpuset will be redirected
to the border nodes. Interleave will then create imbalances at the borders
of the cpuset.

This patch restricts the nodes to the currently allowed cpuset.

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

----

I still wonder if this is the right approach. Could mbind be used to set 
up policies that are larger than the existing cpuset? Or could mbind be 
used to set up a policy and then the cpuset would change?



Index: linux-2.6.19-mm1/mm/mempolicy.c
===================================================================
--- linux-2.6.19-mm1.orig/mm/mempolicy.c	2006-12-11 19:00:38.224610647 -0800
+++ linux-2.6.19-mm1/mm/mempolicy.c	2006-12-13 11:13:10.175294067 -0800
@@ -882,6 +882,7 @@ 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;
 	return do_mbind(start, len, mode, &nodes, flags);

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

             reply	other threads:[~2007-01-04 19:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-04 19:16 Christoph Lameter [this message]
2007-01-04 19:20 ` Paul Jackson
2007-01-10  0:23 ` Andi Kleen

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=Pine.LNX.4.64.0701041115220.22710@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=ak@suse.de \
    --cc=linux-mm@kvack.org \
    --cc=pj@sgi.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox