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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <lee.schermerhorn@xxxxxx>

 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 */
--
To unsubscribe from this list: send the line "unsubscribe linux-numa" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]     [Devices]

  Powered by Linux