On 31/05/21 12:21, Peter Zijlstra wrote: > On Wed, May 19, 2021 at 09:02:34AM -0000, tip-bot2 for Yejune Deng wrote: >> @@ -19,11 +19,7 @@ unsigned int check_preemption_disabled(const char *what1, const char *what2) >> if (irqs_disabled()) >> goto out; >> >> - /* >> - * Kernel threads bound to a single CPU can safely use >> - * smp_processor_id(): >> - */ >> - if (current->nr_cpus_allowed == 1) >> + if (is_percpu_thread()) >> goto out; > > So my test box was unhappy with all this and started spewing lots of > DEBUG_PREEMPT warns on boot. > I get these too, though can't recall getting them when testing the above. I think it's tied with what Frederic found out with copy_process() copying PF_NO_SETAFFINITY, which it now no longer does. > This extends 8fb12156b8db6 to cover the new requirement. > > --- > Subject: 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@xxxxxxxxxxxxx> Tested-by: Valentin Schneider <valentin.schneider@xxxxxxx> Reviewed-by: Valentin Schneider <valentin.schneider@xxxxxxx>
![]() |