Commit 126f3627 authored by David Rientjes's avatar David Rientjes Committed by Greg Kroah-Hartman

mm/mempolicy.c: fix mempolicy printing in numa_maps

commit 8790c71a upstream.

As a result of commit 5606e387 ("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: default avatarDavid Rientjes <rientjes@google.com>
Reported-by: default avatarRobert Lippert <rlippert@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Acked-by: default avatarMel Gorman <mgorman@suse.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: <stable@vger.kernel.org>	[3.7+]
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6065e532
...@@ -2801,7 +2801,7 @@ int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol) ...@@ -2801,7 +2801,7 @@ int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol)
*/ */
VM_BUG_ON(maxlen < strlen("interleave") + strlen("relative") + 16); 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; mode = MPOL_DEFAULT;
else else
mode = pol->mode; mode = pol->mode;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment