linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch for-3.14] mm, mempolicy: fix mempolicy printing in numa_maps
@ 2014-01-26  3:12 David Rientjes
  2014-01-27 10:50 ` Peter Zijlstra
  2014-01-27 11:03 ` Mel Gorman
  0 siblings, 2 replies; 7+ messages in thread
From: David Rientjes @ 2014-01-26  3:12 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds
  Cc: Mel Gorman, Ingo Molnar, Peter Zijlstra, Rik van Riel,
	linux-kernel, linux-mm

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.

Reported-by: Robert Lippert <rlippert@google.com>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 This affects all 3.7+ kernels and is intended for stable but will need to
 be rebased after it's merged since mpol_to_str() has subsequently
 changed.  I'll rebase and propose it separately.

 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
@@ -2926,7 +2926,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;
 	}

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-01-28  8:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-26  3:12 [patch for-3.14] mm, mempolicy: fix mempolicy printing in numa_maps David Rientjes
2014-01-27 10:50 ` Peter Zijlstra
2014-01-27 13:09   ` Mel Gorman
2014-01-28  0:13     ` David Rientjes
2014-01-27 11:03 ` Mel Gorman
2014-01-27 23:31   ` David Rientjes
2014-01-28  8:57     ` Mel Gorman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox