From: Valentin Schneider <valentin.schneider@arm.com>
To: Frederic Weisbecker <frederic@kernel.org>
Cc: Guenter Roeck <linux@roeck-us.net>,
linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
x86@kernel.org
Subject: Re: [tip: sched/core] sched/core: Initialize the idle task with preemption disabled
Date: Wed, 07 Jul 2021 13:11:59 +0100 [thread overview]
Message-ID: <87czru727k.mognet@arm.com> (raw)
In-Reply-To: <20210707120305.GB115752@lothringen>
On 07/07/21 14:03, Frederic Weisbecker wrote:
> On Wed, Jul 07, 2021 at 12:55:20AM +0100, Valentin Schneider wrote:
>> Thanks for the report.
>>
>> So somehow the init task ends up with a non-zero preempt_count()? Per
>> FORK_PREEMPT_COUNT we should exit __ret_from_fork() with a zero count, are
>> you hitting the WARN_ONCE() in finish_task_switch()?
>>
>> Does CONFIG_DEBUG_PREEMPT=y yield anything interesting?
>>
>> I can't make sense of this right now, but it's a bit late :) I'll grab some
>> toolchain+qemu tomorrow and go poke at it (and while at it I need to do the
>> same with powerpc).
>
> One possible issue is that s390's init_idle_preempt_count() doesn't apply on the
> target idle task but on the _current_ CPU. And since smp_init() ->
> idle_threads_init() is actually called remotely, we are overwriting the current
> CPU preempt_count() instead of the target one.
Indeed, this becomes quite obvious when tracing the preemption count
changes. This also means that s390 relied on the idle_thread_get() from the
hotplug machinery to properly setup the preempt count, rather than
init_idle_preempt_count() - which is quite yuck.
I'll write a patch for that and likely one for powerpc.
next prev parent reply other threads:[~2021-07-07 12:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-12 9:46 [PATCH] sched: Initialize the idle task with preemption disabled Valentin Schneider
2021-05-12 11:15 ` [tip: sched/core] sched/core: " tip-bot2 for Valentin Schneider
2021-07-06 19:44 ` Guenter Roeck
2021-07-06 23:55 ` Valentin Schneider
2021-07-07 4:06 ` Guenter Roeck
2021-07-07 12:03 ` Frederic Weisbecker
2021-07-07 12:11 ` Valentin Schneider [this message]
2021-07-07 14:14 ` Guenter Roeck
2021-07-07 14:35 ` Alexey Kardashevskiy
2021-07-07 14:57 ` Valentin Schneider
2021-07-07 15:31 ` Guenter Roeck
2021-07-07 16:35 ` Guenter Roeck
2021-07-07 17:31 ` Valentin Schneider
2021-07-08 1:50 ` Alexey Kardashevskiy
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=87czru727k.mognet@arm.com \
--to=valentin.schneider@arm.com \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
/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