diff mbox series

mm/mempolicy: count MPOL_WEIGHTED_INTERLEAVE to "interleave_hit"

Message ID 20241227095737.645-1-honggyu.kim@sk.com (mailing list archive)
State New
Headers show
Series mm/mempolicy: count MPOL_WEIGHTED_INTERLEAVE to "interleave_hit" | expand

Commit Message

Honggyu Kim Dec. 27, 2024, 9:57 a.m. UTC
The fa3bea4e1f82 introduced MPOL_WEIGHTED_INTERLEAVE but it missed
adding its counter to "interleave_hit" of numastat, which is located at
/sys/devices/system/node/nodeN/ directory.

It'd be better to add weighted interleving counter info to the existing
"interleave_hit" instead of introducing a new counter
"weighted_interleave_hit".

Fixes: fa3bea4e1f82 ("mm/mempolicy: introduce MPOL_WEIGHTED_INTERLEAVE for weighted interleaving")
Cc: Gregory Price <gourry@gourry.net>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Honggyu Kim <honggyu.kim@sk.com>
---
 mm/mempolicy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


base-commit: 4bbf9020becbfd8fc2c3da790855b7042fad455b

Comments

Gregory Price Dec. 27, 2024, 3:37 p.m. UTC | #1
On Fri, Dec 27, 2024 at 06:57:37PM +0900, Honggyu Kim wrote:
> The fa3bea4e1f82 introduced MPOL_WEIGHTED_INTERLEAVE but it missed
> adding its counter to "interleave_hit" of numastat, which is located at
> /sys/devices/system/node/nodeN/ directory.
> 
> It'd be better to add weighted interleving counter info to the existing
> "interleave_hit" instead of introducing a new counter
> "weighted_interleave_hit".
> 
> Fixes: fa3bea4e1f82 ("mm/mempolicy: introduce MPOL_WEIGHTED_INTERLEAVE for weighted interleaving")
> Cc: Gregory Price <gourry@gourry.net>
> Cc: Andi Kleen <ak@linux.intel.com>
> Signed-off-by: Honggyu Kim <honggyu.kim@sk.com>
> ---
>  mm/mempolicy.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

Reviewed-by: Gregory Price <gourry@gourry.net>
diff mbox series

Patch

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 04f35659717a..162407fbf2bc 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2268,7 +2268,8 @@  struct page *alloc_pages_mpol_noprof(gfp_t gfp, unsigned int order,
 
 	page = __alloc_pages_noprof(gfp, order, nid, nodemask);
 
-	if (unlikely(pol->mode == MPOL_INTERLEAVE) && page) {
+	if (unlikely(pol->mode == MPOL_INTERLEAVE ||
+		     pol->mode == MPOL_WEIGHTED_INTERLEAVE) && page) {
 		/* skip NUMA_INTERLEAVE_HIT update if numa stats is disabled */
 		if (static_branch_likely(&vm_numa_stat_key) &&
 		    page_to_nid(page) == nid) {