linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Valentin Schneider <valentin.schneider@arm.com>,
	Frederic Weisbecker <frederic@kernel.org>
Cc: 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, 7 Jul 2021 07:14:45 -0700	[thread overview]
Message-ID: <c30097f3-63b4-6fa0-a369-8f4e20ee1040@roeck-us.net> (raw)
In-Reply-To: <87czru727k.mognet@arm.com>

On 7/7/21 5:11 AM, Valentin Schneider wrote:
> 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.
> 

Can you reproduce the problem with a powerpc qemu emulation ?
If so, how do you reproduce it there ? Reason for asking is that I don't see
the problem with any of my powerpc emulations, and I would like to add test
case(s) if possible.

Thanks,
Guenter

  reply	other threads:[~2021-07-07 14:14 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
2021-07-07 14:14           ` Guenter Roeck [this message]
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=c30097f3-63b4-6fa0-a369-8f4e20ee1040@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=valentin.schneider@arm.com \
    --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;
as well as URLs for NNTP newsgroup(s).