public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Valentin Schneider <valentin.schneider@arm.com>
To: Peter Zijlstra <peterz@infradead.org>, linux-kernel@vger.kernel.org
Cc: linux-tip-commits@vger.kernel.org,
	Yejune Deng <yejune.deng@gmail.com>,
	x86@kernel.org
Subject: Re: [PATCH] sched,init: Fix DEBUG_PREEMPT vs early boot
Date: Tue, 01 Jun 2021 12:54:35 +0100	[thread overview]
Message-ID: <87mts9g5qc.mognet@arm.com> (raw)
In-Reply-To: <YLS4mbKUrA3Gnb4t@hirez.programming.kicks-ass.net>

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>

  reply	other threads:[~2021-06-01 11:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 15:10 [PATCH 0/2] sched: Address idle task vs pcpu kthread checks Valentin Schneider
2021-05-10 15:10 ` [PATCH 1/2] sched: Make the idle task quack like a per-CPU kthread Valentin Schneider
2021-05-10 15:57   ` Valentin Schneider
2021-05-11  7:32     ` Ingo Molnar
2021-05-11  9:33       ` Valentin Schneider
2021-05-19  8:09   ` [tip: sched/core] " tip-bot2 for Valentin Schneider
2021-05-10 15:10 ` [PATCH 2/2] lib/smp_processor_id: Use is_percpu_thread() instead of nr_cpus_allowed Valentin Schneider
2021-05-19  8:09   ` [tip: sched/core] " tip-bot2 for Yejune Deng
2021-05-19  9:02   ` tip-bot2 for Yejune Deng
2021-05-31 10:21     ` [PATCH] sched,init: Fix DEBUG_PREEMPT vs early boot Peter Zijlstra
2021-06-01 11:54       ` Valentin Schneider [this message]
2021-06-01 14:04       ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2021-05-12 11:00 ` [PATCH 0/2] sched: Address idle task vs pcpu kthread checks Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mts9g5qc.mognet@arm.com \
    --to=valentin.schneider@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    --cc=yejune.deng@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox