Commit f6032e52 authored by Li Zhijian's avatar Li Zhijian Committed by Peng Zhang
Browse files

mm/vmstat: move pgdemote_* out of CONFIG_NUMA_BALANCING

mainline inclusion
from mainline-v6.8-rc1
commit b805ab3c6935d14654ccc28f16ffce7a13c2c528
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8YBMI

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b805ab3c6935d14654ccc28f16ffce7a13c2c528

--------------------------------

Demotion can work well without CONFIG_NUMA_BALANCING.  But the commit
23e9f0138963 ("mm/vmstat: move pgdemote_* to per-node stats") wrongly hid
it behind CONFIG_NUMA_BALANCING.

Fix it by moving them out of CONFIG_NUMA_BALANCING.

Link: https://lkml.kernel.org/r/20231229022651.3229174-1-lizhijian@fujitsu.com


Fixes: 23e9f0138963 ("mm/vmstat: move pgdemote_* to per-node stats")
Signed-off-by: default avatarLi Zhijian <lizhijian@fujitsu.com>
Cc: "Huang, Ying" <ying.huang@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarZhangPeng <zhangpeng362@huawei.com>
parent b1689282
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -206,11 +206,11 @@ enum node_stat_item {
#ifdef CONFIG_NUMA_BALANCING
	PGPROMOTE_SUCCESS,	/* promote successfully */
	PGPROMOTE_CANDIDATE,	/* candidate pages to promote */
#endif
	/* PGDEMOTE_*: pages demoted */
	PGDEMOTE_KSWAPD,
	PGDEMOTE_DIRECT,
	PGDEMOTE_KHUGEPAGED,
#endif
	NR_VM_NODE_STAT_ITEMS
};

+1 −4
Original line number Diff line number Diff line
@@ -1114,12 +1114,10 @@ void drop_slab(void)

static int reclaimer_offset(void)
{
#ifdef CONFIG_NUMA_BALANCING
	BUILD_BUG_ON(PGSTEAL_DIRECT - PGSTEAL_KSWAPD !=
			PGDEMOTE_DIRECT - PGDEMOTE_KSWAPD);
	BUILD_BUG_ON(PGSTEAL_KHUGEPAGED - PGSTEAL_KSWAPD !=
			PGDEMOTE_KHUGEPAGED - PGDEMOTE_KSWAPD);
#endif
	BUILD_BUG_ON(PGSTEAL_DIRECT - PGSTEAL_KSWAPD !=
			PGSCAN_DIRECT - PGSCAN_KSWAPD);
	BUILD_BUG_ON(PGSTEAL_KHUGEPAGED - PGSTEAL_KSWAPD !=
@@ -1683,10 +1681,9 @@ static unsigned int demote_folio_list(struct list_head *demote_folios,
	migrate_pages(demote_folios, alloc_demote_folio, NULL,
		      (unsigned long)&mtc, MIGRATE_ASYNC, MR_DEMOTION,
		      &nr_succeeded);
#ifdef CONFIG_NUMA_BALANCING

	mod_node_page_state(pgdat, PGDEMOTE_KSWAPD + reclaimer_offset(),
			    nr_succeeded);
#endif

	return nr_succeeded;
}
+1 −1
Original line number Diff line number Diff line
@@ -1244,10 +1244,10 @@ const char * const vmstat_text[] = {
#ifdef CONFIG_NUMA_BALANCING
	"pgpromote_success",
	"pgpromote_candidate",
#endif
	"pgdemote_kswapd",
	"pgdemote_direct",
	"pgdemote_khugepaged",
#endif

	/* enum writeback_stat_item counters */
	"nr_dirty_threshold",