summaryrefslogtreecommitdiff
path: root/kernel/sched
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2021-05-31 12:21:13 +0200
committerPeter Zijlstra <peterz@infradead.org>2021-06-01 16:00:11 +0200
commit15faafc6b449777a85c0cf82dd8286c293fed4eb (patch)
treeaaa65f485e131cc6f4d46219a05d9c5050b99189 /kernel/sched
parent7b419f47facd286c6723daca6ad69ec355473f78 (diff)
sched,init: Fix DEBUG_PREEMPT vs early boot
Extend 8fb12156b8db ("init: Pin init task to the boot CPU, initially") to cover the new PF_NO_SETAFFINITY requirement. While there, move wait_for_completion(&kthreadd_done) into kernel_init() to make it absolutely clear it is the very first thing done by the init thread. Fixes: 570a752b7a9b ("lib/smp_processor_id: Use is_percpu_thread() instead of nr_cpus_allowed") Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Valentin Schneider <valentin.schneider@arm.com> Tested-by: Valentin Schneider <valentin.schneider@arm.com> Tested-by: Borislav Petkov <bp@alien8.de> Link: https://lkml.kernel.org/r/YLS4mbKUrA3Gnb4t@hirez.programming.kicks-ass.net
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 3d2527239c3e..e205c191b7fb 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8862,6 +8862,7 @@ void __init sched_init_smp(void)
/* Move init over to a non-isolated CPU */
if (set_cpus_allowed_ptr(current, housekeeping_cpumask(HK_FLAG_DOMAIN)) < 0)
BUG();
+ current->flags &= ~PF_NO_SETAFFINITY;
sched_init_granularity();
init_sched_rt_class();