Skip to content

Commit bd3d56f

Browse files
donettom-1akpm00
authored andcommitted
mm: vmscan : pgdemote vmstat is not getting updated when MGLRU is enabled.
When MGLRU is enabled, the pgdemote_kswapd, pgdemote_direct, and pgdemote_khugepaged stats in vmstat are not being updated. Commit f77f0c7 ("mm,memcg: provide per-cgroup counters for NUMA balancing operations") moved the pgdemote vmstat update from demote_folio_list() to shrink_inactive_list(), which is in the normal LRU path. As a result, the pgdemote stats are updated correctly for the normal LRU but not for MGLRU. To address this, we have added the pgdemote stat update in the evict_folios() function, which is in the MGLRU path. With this patch, the pgdemote stats will now be updated correctly when MGLRU is enabled. Without this patch vmstat output when MGLRU is enabled ====================================================== pgdemote_kswapd 0 pgdemote_direct 0 pgdemote_khugepaged 0 With this patch vmstat output when MGLRU is enabled =================================================== pgdemote_kswapd 43234 pgdemote_direct 4691 pgdemote_khugepaged 0 Link: https://lkml.kernel.org/r/[email protected] Fixes: f77f0c7 ("mm,memcg: provide per-cgroup counters for NUMA balancing operations") Signed-off-by: Donet Tom <[email protected]> Acked-by: Yu Zhao <[email protected]> Tested-by: Li Zhijian <[email protected]> Reviewed-by: Li Zhijian <[email protected]> Cc: Aneesh Kumar K.V (Arm) <[email protected]> Cc: David Rientjes <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Kaiyang Zhao <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Muchun Song <[email protected]> Cc: Ritesh Harjani (IBM) <[email protected]> Cc: Roman Gushchin <[email protected]> Cc: Shakeel Butt <[email protected]> Cc: Wei Xu <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 9fd8fcf commit bd3d56f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mm/vmscan.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4642,6 +4642,9 @@ static int evict_folios(struct lruvec *lruvec, struct scan_control *sc, int swap
46424642
reset_batch_size(walk);
46434643
}
46444644

4645+
__mod_lruvec_state(lruvec, PGDEMOTE_KSWAPD + reclaimer_offset(),
4646+
stat.nr_demoted);
4647+
46454648
item = PGSTEAL_KSWAPD + reclaimer_offset();
46464649
if (!cgroup_reclaim(sc))
46474650
__count_vm_events(item, reclaimed);

0 commit comments

Comments
 (0)