linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/numa_balancing: Teach mpol_to_str about the balancing mode
@ 2024-06-25 13:26 Tvrtko Ursulin
  2024-06-26  8:48 ` Huang, Ying
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Tvrtko Ursulin @ 2024-06-25 13:26 UTC (permalink / raw)
  To: linux-mm
  Cc: linux-kernel, kernel-dev, Tvrtko Ursulin, Huang Ying, Mel Gorman,
	Peter Zijlstra, Ingo Molnar, Rik van Riel, Johannes Weiner,
	Matthew Wilcox (Oracle),
	Dave Hansen, Andi Kleen, Michal Hocko, David Rientjes

From: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>

If a task has had MPOL_F_NUMA_BALANCING set it is useful to show that in
procfs. Teach the mpol_to_str helper about its existance and while at it
update the comment to account for "weighted interleave" when suggesting
a recommended buffer size.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
References: bda420b98505 ("numa balancing: migrate on fault among multiple bound nodes")
Cc: Huang Ying <ying.huang@intel.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: David Rientjes <rientjes@google.com>
---
 mm/mempolicy.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index aec756ae5637..d147287c4505 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -3293,8 +3293,9 @@ int mpol_parse_str(char *str, struct mempolicy **mpol)
  * @pol:  pointer to mempolicy to be formatted
  *
  * Convert @pol into a string.  If @buffer is too short, truncate the string.
- * Recommend a @maxlen of at least 32 for the longest mode, "interleave", the
- * longest flag, "relative", and to display at least a few node ids.
+ * Recommend a @maxlen of at least 42 for the longest mode, "weighted
+ * interleave", the longest flag, "balancing", and to display at least a few
+ * node ids.
  */
 void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol)
 {
@@ -3331,12 +3332,15 @@ void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol)
 		p += snprintf(p, buffer + maxlen - p, "=");
 
 		/*
-		 * Currently, the only defined flags are mutually exclusive
+		 * The below two flags are mutually exclusive:
 		 */
 		if (flags & MPOL_F_STATIC_NODES)
 			p += snprintf(p, buffer + maxlen - p, "static");
 		else if (flags & MPOL_F_RELATIVE_NODES)
 			p += snprintf(p, buffer + maxlen - p, "relative");
+
+		if (flags & MPOL_F_NUMA_BALANCING)
+			p += snprintf(p, buffer + maxlen - p, "balancing");
 	}
 
 	if (!nodes_empty(nodes))
-- 
2.44.0



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

end of thread, other threads:[~2024-06-28  9:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-25 13:26 [PATCH] mm/numa_balancing: Teach mpol_to_str about the balancing mode Tvrtko Ursulin
2024-06-26  8:48 ` Huang, Ying
2024-06-26 11:51   ` Tvrtko Ursulin
2024-06-27  3:04     ` Huang, Ying
2024-06-27 21:37 ` Andrew Morton
2024-06-28  9:03   ` Tvrtko Ursulin
2024-06-27 21:47 ` Matthew Wilcox
2024-06-28  3:12   ` Huang, Ying
2024-06-28  8:56     ` Tvrtko Ursulin
2024-06-28  9:32       ` Huang, Ying

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