mm/mempolicy.c: fix mempolicy printing in numa_maps
authorDavid Rientjes <[email protected]>
Thu, 30 Jan 2014 23:46:08 +0000 (15:46 -0800)
committerLinus Torvalds <[email protected]>
Fri, 31 Jan 2014 00:56:56 +0000 (16:56 -0800)
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 <[email protected]>
Reported-by: Robert Lippert <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Acked-by: Mel Gorman <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: <[email protected]> [3.7+]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/mempolicy.c

index 873de7e542bc91993e6922a6b5ada5d4759a6da6..ae3c8f3595d4ff522f0427b05ace2f7e041da8ad 100644 (file)
@@ -2930,7 +2930,7 @@ void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol)
        unsigned short mode = MPOL_DEFAULT;
        unsigned short flags = 0;
 
-       if (pol && pol != &default_policy) {
+       if (pol && pol != &default_policy && !(pol->flags & MPOL_F_MORON)) {
                mode = pol->mode;
                flags = pol->flags;
        }