quoted hunk ↗ jump to hunk
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 04b62c16fa8c..98f4f9434965 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8712,6 +8712,14 @@ int sched_cpu_deactivate(unsigned int cpu)
set_cpu_active(cpu, false);
+#ifdef CONFIG_PREFERRED_CPU
+ if (cpumask_empty(cpu_preferred_mask)) {
+ pr_notice("sched: last preferred CPU%u offlined; make all active CPUs preferred\n",
+ cpu);
+ reset_preferred_cpumask();
Hi, Yury
If the CPU being offlined is the only preferred CPU, after
reset_preferred_cpumask(), the steal governor may still need
some time to tighten the mask again, and eventually only one
preferred CPU may remain. Would this introduce additional
task migration overhead?
Regards,
Fushuai.
quoted hunk ↗ jump to hunk
+ }
+#endif
+
/*
* From this point forward, this CPU will refuse to run any task that
* is not: migrate_disable() or KTHREAD_IS_PER_CPU, and will actively