> diff --git a/include/linux/sched/numa_balancing.h b/include/linux/sched/numa_balancing.h > index 52b22c5c396d..792b6665f476 100644 > --- a/include/linux/sched/numa_balancing.h > +++ b/include/linux/sched/numa_balancing.h [ ... ] > @@ -32,6 +33,28 @@ extern void set_numabalancing_state(bool enabled); > extern void task_numa_free(struct task_struct *p, bool final); > bool should_numa_migrate_memory(struct task_struct *p, struct folio *folio, > int src_nid, int dst_cpu); > + > +extern struct static_key_false sched_numa_balancing; > +static inline bool task_numab_enabled(struct task_struct *p) > +{ > + if (static_branch_unlikely(&sched_numa_balancing)) > + return true; > + return false; > +} > + > +static inline bool task_numab_mode_normal(void) > +{ > + if (sysctl_numa_balancing_mode & NUMA_BALANCING_NORMAL) > + return true; > + return false; > +} > + > +static inline bool task_numab_mode_tiering(void) > +{ > + if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) > + return true; > + return false; > +} > #else > static inline void task_numa_fault(int last_node, int node, int pages, > int flags) [ ... ] > @@ -52,6 +75,10 @@ static inline bool should_numa_migrate_memory(struct task_struct *p, > { > return true; > } > +static inline bool task_numab_enabled(struct task_struct *p) > +{ > + return false; > +} > #endif The #else block adds a stub for task_numab_enabled(), but task_numab_mode_normal() and task_numab_mode_tiering() are missing from this section. These helpers are defined when CONFIG_NUMA_BALANCING is enabled, but have no stubs when it is disabled. > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 670fe9fae5ba..7ee5695326e3 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c [ ... ] > @@ -4843,9 +4844,7 @@ static bool should_abort_scan(struct lruvec *lruvec, struct scan_control *sc) > if (!current_is_kswapd() || sc->order) > return false; > > - mark = sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING ? > - WMARK_PROMO : WMARK_HIGH; > - > + mark = task_numab_mode_tiering() ? WMARK_PROMO : WMARK_HIGH; [ ... ] > @@ -6774,7 +6773,7 @@ static bool pgdat_balanced(pg_data_t *pgdat, int order, int highest_zoneidx) > enum zone_stat_item item; > unsigned long free_pages; > > - if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) > + if (task_numab_mode_tiering()) > mark = promo_wmark_pages(zone); The original sysctl_numa_balancing_mode is defined to 0 when CONFIG_NUMA_BALANCING is disabled (see include/linux/sched/sysctl.h), allowing this code to compile and work correctly in both configurations. The new task_numab_mode_tiering() helper lacks a stub in the #else block, so should_abort_scan() and pgdat_balanced() in mm/vmscan.c will fail to compile when CONFIG_NUMA_BALANCING is not enabled. Would it make sense to add stubs for task_numab_mode_normal() and task_numab_mode_tiering() to the #else block, returning false to match the original behavior when sysctl_numa_balancing_mode is defined as 0? --- AI reviewed your patch. Please fix the bug or email reply why it's not a bug. See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md CI run summary: https://github.com/kernel-patches/bpf/actions/runs/20956455529