]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/vmscan: accumulate nr_demoted for accurate demotion statistics
authorLi Zhijian <lizhijian@fujitsu.com>
Fri, 10 Jan 2025 12:21:32 +0000 (20:21 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 26 Jan 2025 23:04:59 +0000 (15:04 -0800)
commit14af02d3a789353e1c24c670532b2f6d5e242de1
tree78585fc8dff8763d913796c1a84327faf1a16f63
parentc955ebf3bcd36be36610efa19495bbc1c2c887c3
mm/vmscan: accumulate nr_demoted for accurate demotion statistics

In shrink_folio_list(), demote_folio_list() can be called 2 times.
Currently stat->nr_demoted will only store the last nr_demoted( the later
nr_demoted is always zero, the former nr_demoted will get lost), as a
result number of demoted pages is not accurate.

Accumulate the nr_demoted count across multiple calls to
demote_folio_list(), ensuring accurate reporting of demotion statistics.

Link: https://lkml.kernel.org/r/20250110122133.423481-1-lizhijian@fujitsu.com
Fixes: f77f0c751478 ("mm,memcg: provide per-cgroup counters for NUMA balancing operations")
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Acked-by: Kaiyang Zhao <kaiyang2@cs.cmu.edu>
Tested-by: Donet Tom <donettom@linux.ibm.com>
Reviewed-by: Donet Tom <donettom@linux.ibm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmscan.c