linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Ken Chen" <kenchen@google.com>
To: Paul Jackson <pj@sgi.com>, Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
Subject: [patch] check cpuset mems_allowed for sys_mbind
Date: Wed, 9 May 2007 16:11:44 -0700	[thread overview]
Message-ID: <b040c32a0705091611mb35258ap334426e42d33372c@mail.gmail.com> (raw)

I wonder why we don't check cpuset's mems_allowed node mask in the
sys_mbind() path?  sys_set_mempolicy() however, does the enforcement
against cpuset so process can not accidentally set mempolicy with
memory node mask that are not allowed to allocated from.  I think we
should have the equivalent check in the mbind path.   Otherwise, there
are discrepancy in what sys_mbind agrees to versus what the page
allocation policy that enforced by cpuset.  This discrepancy
subsequently causes performance surprises to the application.

Or is it left out intentionally?  for what reason?


Signed-off-by: Ken Chen <kenchen@google.com>

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index d76e8eb..ef81080 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -762,7 +762,7 @@ long do_mbind(unsigned long start, unsig
 	if (end == start)
 		return 0;

-	if (mpol_check_policy(mode, nmask))
+	if (contextualize_policy(mode, nmask))
 		return -EINVAL;

 	new = mpol_new(mode, nmask);

--
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-05-09 23:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-09 23:11 Ken Chen [this message]
2007-05-09 23:48 ` Paul Jackson
2007-05-10  0:47   ` Ken Chen
2007-05-10  0:55     ` Christoph Lameter
2007-05-10  1:26       ` Ken Chen
2007-05-10  1:44         ` Christoph Lameter
2007-05-10 18:32       ` Ken Chen
2007-05-10 18:41         ` Christoph Lameter
2007-05-10 19:30           ` Ken Chen

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=b040c32a0705091611mb35258ap334426e42d33372c@mail.gmail.com \
    --to=kenchen@google.com \
    --cc=akpm@linux-foundation.org \
    --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