Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm/mempolicy: count MPOL_WEIGHTED_INTERLEAVE to "interleave_hit"

Commit 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".

Link: https://lkml.kernel.org/r/20241227095737.645-1-honggyu.kim@sk.com
Fixes: fa3bea4e1f82 ("mm/mempolicy: introduce MPOL_WEIGHTED_INTERLEAVE for weighted interleaving")
Signed-off-by: Honggyu Kim <honggyu.kim@sk.com>
Reviewed-by: Gregory Price <gourry@gourry.net>
Reviewed-by: Hyeonggon Yoo <hyeonggon.yoo@sk.com>
Tested-by: Yunjeong Mun <yunjeong.mun@sk.com>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Honggyu Kim and committed by
Andrew Morton
264a88ca 2bff77c6

+2 -1
+2 -1
mm/mempolicy.c
··· 2268 2268 2269 2269 page = __alloc_pages_noprof(gfp, order, nid, nodemask); 2270 2270 2271 - if (unlikely(pol->mode == MPOL_INTERLEAVE) && page) { 2271 + if (unlikely(pol->mode == MPOL_INTERLEAVE || 2272 + pol->mode == MPOL_WEIGHTED_INTERLEAVE) && page) { 2272 2273 /* skip NUMA_INTERLEAVE_HIT update if numa stats is disabled */ 2273 2274 if (static_branch_likely(&vm_numa_stat_key) && 2274 2275 page_to_nid(page) == nid) {