[3.8.y.z extended stable] Patch "mm/mempolicy.c: fix mempolicy printing in numa_maps" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Fri Feb 7 21:37:18 UTC 2014


This is a note to let you know that I have just added a patch titled

    mm/mempolicy.c: fix mempolicy printing in numa_maps

to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.8.y-queue

This patch is scheduled to be released in version 3.8.13.18.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.8.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From c19739f3f811f7e5c5476cf530c41877b182d4cd Mon Sep 17 00:00:00 2001
From: David Rientjes <rientjes at google.com>
Date: Thu, 30 Jan 2014 15:46:08 -0800
Subject: mm/mempolicy.c: fix mempolicy printing in numa_maps

commit 8790c71a18e5d2d93532ae250bcf5eddbba729cd upstream.

As a result of commit 5606e3877ad8 ("mm: numa: Migrate on reference
policy"), /proc/<pid>/numa_maps prints the mempolicy for any <pid> as
"prefer:N" for the local node, N, of the process reading the file.

This should only be printed when the mempolicy of <pid> is
MPOL_PREFERRED for node N.

If the process is actually only using the default mempolicy for local
node allocation, make sure "default" is printed as expected.

Signed-off-by: David Rientjes <rientjes at google.com>
Reported-by: Robert Lippert <rlippert at google.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Acked-by: Mel Gorman <mgorman at suse.de>
Cc: Ingo Molnar <mingo at kernel.org>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
[ kamal: backport to 3.8 (reversed if-clause logic) ]
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 mm/mempolicy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 2d49a12..eb2848e 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2801,7 +2801,7 @@ int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol)
 	 */
 	VM_BUG_ON(maxlen < strlen("interleave") + strlen("relative") + 16);

-	if (!pol || pol == &default_policy)
+	if (!pol || pol == &default_policy || (pol->flags & MPOL_F_MORON))
 		mode = MPOL_DEFAULT;
 	else
 		mode = pol->mode;
--
1.8.3.2





More information about the kernel-team mailing list