[patch -stable] mm/mempolicy.c: fix mempolicy printing in numa_maps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit 8790c71a18e5d2d93532ae250bcf5eddbba729cd upstream.

As a result of 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@xxxxxxxxxx>
Reported-by: Robert Lippert <rlippert@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Acked-by: Mel Gorman <mgorman@xxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx>	[3.7+]
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---
 This is a backport to the 3.10 and 3.12 stable trees.
 The original commit may be applied to the 3.13 stable tree directly.

 mm/mempolicy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
--- 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;
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]