hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9PEF6 CVE: NA
----------------------------------------
Silence complier error with allnoconfig.
Implicit declaration of function without CONFIG_CGROUP_SCHED: 1. tg_update_affinity_domains 2. init_auto_affinity
Fixes: 713cfd2684fa ("sched: Introduce smart grid scheduling strategy for cfs") Signed-off-by: Yipeng Zou zouyipeng@huawei.com --- kernel/sched/core.c | 7 +++++++ kernel/sched/fair.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 4aafc0269f11..0759ba8de27b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5843,7 +5843,9 @@ int sched_cpu_activate(unsigned int cpu) static_branch_inc_cpuslocked(&sched_smt_present); #endif set_cpu_active(cpu, true); +#ifdef CONFIG_QOS_SCHED_SMART_GRID tg_update_affinity_domains(cpu, 1); +#endif
if (sched_smp_initialized) { sched_domains_numa_masks_set(cpu); @@ -5906,7 +5908,9 @@ int sched_cpu_deactivate(unsigned int cpu) return ret; } sched_domains_numa_masks_clear(cpu); +#ifdef CONFIG_QOS_SCHED_SMART_GRID tg_update_affinity_domains(cpu, 0); +#endif return 0; }
@@ -5979,7 +5983,10 @@ void __init sched_init_smp(void) sched_smp_initialized = true;
sched_grid_zone_init(); + +#ifdef CONFIG_QOS_SCHED_SMART_GRID init_auto_affinity(&root_task_group); +#endif }
static int __init migration_init(void) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index ce182846e2cf..3414c149b1f4 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5783,7 +5783,7 @@ int tg_rebuild_affinity_domains(int cpu, struct auto_affinity *auto_affi) return ret; } #else -static void destroy_auto_affinity(struct task_group *tg) {} +static void __maybe_unused destroy_auto_affinity(struct task_group *tg) {}
#ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY static inline bool prefer_cpus_valid(struct task_struct *p);