[PATCH 1/6] Mempolicy: Don't call mpol_set_nodemask() when no_context

Lee Schermerhorn <[email protected]>
Newsgroups org.kernel.vger.linux-numa,org.kvack.linux-mm
Message-ID <[email protected]>
Atop Kosaki Motohiro's mpol_parse_str() cleanup series.

No need to call mpol_set_nodemask() when we have no context for
the mempolicy.  This can occur when we're parsing a tmpfs 'mpol'
mount option.  Just save the raw nodemask in the mempolicy's
w.user_nodemask member for use when a tmpfs/shmem file is
created.  mpol_shared_policy_init() will "contextualize" the
policy for the new file based on the creating task's context.

Signed-off-by: Lee Schermerhorn <[email protected]>

 mm/mempolicy.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Index: linux-2.6.34-rc1-mmotm-100311-1313/mm/mempolicy.c
===================================================================
--- linux-2.6.34-rc1-mmotm-100311-1313.orig/mm/mempolicy.c	2010-03-19 09:03:14.000000000 -0400
+++ linux-2.6.34-rc1-mmotm-100311-1313/mm/mempolicy.c	2010-03-19 09:03:17.000000000 -0400
@@ -2245,7 +2245,10 @@ int mpol_parse_str(char *str, struct mem
 	if (IS_ERR(new))
 		goto out;
 
-	{
+	if (no_context) {
+		/* save for contextualization */
+		new->w.user_nodemask = nodes;
+	} else {
 		int ret;
 		NODEMASK_SCRATCH(scratch);
 		if (scratch) {
@@ -2261,10 +2264,6 @@ int mpol_parse_str(char *str, struct mem
 		}
 	}
 	err = 0;
-	if (no_context) {
-		/* save for contextualization */
-		new->w.user_nodemask = nodes;
-	}
 
 out:
 	/* Restore string for error message */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.