lkml.org 
[lkml]   [2021]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] sched,init: Fix DEBUG_PREEMPT vs early boot
Date
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@infradead.org>

Tested-by: Valentin Schneider <valentin.schneider@arm.com>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>

\
 
 \ /
  Last update: 2021-06-01 13:54    [W:0.088 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site