Skip to content

Commit 8790c71

Browse files
rientjestorvalds
authored andcommitted
mm/mempolicy.c: fix mempolicy printing in numa_maps
As a result of commit 5606e38 ("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]>
1 parent e46e331 commit 8790c71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/mempolicy.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2930,7 +2930,7 @@ void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol)
29302930
unsigned short mode = MPOL_DEFAULT;
29312931
unsigned short flags = 0;
29322932

2933-
if (pol && pol != &default_policy) {
2933+
if (pol && pol != &default_policy && !(pol->flags & MPOL_F_MORON)) {
29342934
mode = pol->mode;
29352935
flags = pol->flags;
29362936
}

0 commit comments

Comments
 (0)