diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 7a45015274ab1674df3ec212d007865630978012..2a46f44074145fed1f40bb205c80bd09f0b257e1 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1558,6 +1558,7 @@ static void __sched_fork(struct task_struct *p) } #ifdef CONFIG_NUMA_BALANCING +#ifdef CONFIG_SCHED_DEBUG void set_numabalancing_state(bool enabled) { if (enabled) @@ -1565,6 +1566,14 @@ void set_numabalancing_state(bool enabled) else sched_feat_set("NO_NUMA"); } +#else +__read_mostly bool numabalancing_enabled; + +void set_numabalancing_state(bool enabled) +{ + numabalancing_enabled = enabled; +} +#endif /* CONFIG_SCHED_DEBUG */ #endif /* CONFIG_NUMA_BALANCING */ /* diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index ae31c051ff2f1847db72ed3c18ae75a36377a1bf..4f93d031875a12b22727e2daacb2716282e705a0 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -650,9 +650,15 @@ extern struct static_key sched_feat_keys[__SCHED_FEAT_NR]; #ifdef CONFIG_NUMA_BALANCING #define sched_feat_numa(x) sched_feat(x) +#ifdef CONFIG_SCHED_DEBUG +#define numabalancing_enabled sched_feat_numa(NUMA) +#else +extern bool numabalancing_enabled; +#endif /* CONFIG_SCHED_DEBUG */ #else #define sched_feat_numa(x) (0) -#endif +#define numabalancing_enabled (0) +#endif /* CONFIG_NUMA_BALANCING */ static inline u64 global_rt_period(void) {