mm/mempolicy.c: fix mempolicy printing in numa_maps
commit8790c71a18upstream. As a result of commit5606e3877a("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@google.com> Reported-by: Robert Lippert <rlippert@google.com> Cc: Peter Zijlstra <peterz@infradead.org> Acked-by: Mel Gorman <mgorman@suse.de> Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4a466742d2
commit
41d3f491c9
@ -2928,7 +2928,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user