Skip to content

Commit b805ab3

Browse files
zhijianli88akpm00
authored andcommitted
mm/vmstat: move pgdemote_* out of CONFIG_NUMA_BALANCING
Demotion can work well without CONFIG_NUMA_BALANCING. But the commit 23e9f01 ("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: 23e9f01 ("mm/vmstat: move pgdemote_* to per-node stats") Signed-off-by: Li 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: Andrew Morton <akpm@linux-foundation.org>
1 parent fc8580e commit b805ab3

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

include/linux/mmzone.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,11 @@ enum node_stat_item {
207207
#ifdef CONFIG_NUMA_BALANCING
208208
PGPROMOTE_SUCCESS, /* promote successfully */
209209
PGPROMOTE_CANDIDATE, /* candidate pages to promote */
210+
#endif
210211
/* PGDEMOTE_*: pages demoted */
211212
PGDEMOTE_KSWAPD,
212213
PGDEMOTE_DIRECT,
213214
PGDEMOTE_KHUGEPAGED,
214-
#endif
215215
NR_VM_NODE_STAT_ITEMS
216216
};
217217

mm/vmscan.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,12 +409,10 @@ void drop_slab(void)
409409

410410
static int reclaimer_offset(void)
411411
{
412-
#ifdef CONFIG_NUMA_BALANCING
413412
BUILD_BUG_ON(PGSTEAL_DIRECT - PGSTEAL_KSWAPD !=
414413
PGDEMOTE_DIRECT - PGDEMOTE_KSWAPD);
415414
BUILD_BUG_ON(PGSTEAL_KHUGEPAGED - PGSTEAL_KSWAPD !=
416415
PGDEMOTE_KHUGEPAGED - PGDEMOTE_KSWAPD);
417-
#endif
418416
BUILD_BUG_ON(PGSTEAL_DIRECT - PGSTEAL_KSWAPD !=
419417
PGSCAN_DIRECT - PGSCAN_KSWAPD);
420418
BUILD_BUG_ON(PGSTEAL_KHUGEPAGED - PGSTEAL_KSWAPD !=
@@ -978,10 +976,9 @@ static unsigned int demote_folio_list(struct list_head *demote_folios,
978976
migrate_pages(demote_folios, alloc_demote_folio, NULL,
979977
(unsigned long)&mtc, MIGRATE_ASYNC, MR_DEMOTION,
980978
&nr_succeeded);
981-
#ifdef CONFIG_NUMA_BALANCING
979+
982980
mod_node_page_state(pgdat, PGDEMOTE_KSWAPD + reclaimer_offset(),
983981
nr_succeeded);
984-
#endif
985982

986983
return nr_succeeded;
987984
}

mm/vmstat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1248,10 +1248,10 @@ const char * const vmstat_text[] = {
12481248
#ifdef CONFIG_NUMA_BALANCING
12491249
"pgpromote_success",
12501250
"pgpromote_candidate",
1251+
#endif
12511252
"pgdemote_kswapd",
12521253
"pgdemote_direct",
12531254
"pgdemote_khugepaged",
1254-
#endif
12551255

12561256
/* enum writeback_stat_item counters */
12571257
"nr_dirty_threshold",

0 commit comments

Comments
 (0)