From: Heiko Carstens <hca@linux.ibm.com>
To: Valentin Schneider <valentin.schneider@arm.com>
Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
Guenter Roeck <linux@roeck-us.net>,
Vasily Gorbik <gor@linux.ibm.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Frederic Weisbecker <frederic@kernel.org>,
Alexey Kardashevskiy <aik@ozlabs.ru>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH] s390: preempt: Fix preempt_count initialization
Date: Thu, 8 Jul 2021 16:17:10 +0200 [thread overview]
Message-ID: <YOcI5iAZnHS9rtRT@osiris> (raw)
In-Reply-To: <20210707163338.1623014-1-valentin.schneider@arm.com>
On Wed, Jul 07, 2021 at 05:33:38PM +0100, Valentin Schneider wrote:
> S390's init_idle_preempt_count(p, cpu) doesn't actually let us initialize the
> preempt_count of the requested CPU's idle task: it unconditionally writes
> to the current CPU's. This clearly conflicts with idle_threads_init(),
> which intends to initialize *all* the idle tasks, including their
> preempt_count (or their CPU's, if the arch uses a per-CPU preempt_count).
>
> Unfortunately, it seems the way s390 does things doesn't let us initialize
> every possible CPU's preempt_count early on, as the pages where this
> resides are only allocated when a CPU is brought up and are freed when it
> is brought down.
>
> Let the arch-specific code set a CPU's preempt_count when its lowcore is
> allocated, and turn init_idle_preempt_count() into an empty stub.
>
> Fixes: f1a0a376ca0c ("sched/core: Initialize the idle task with preemption disabled")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
> ---
> arch/s390/include/asm/preempt.h | 16 ++++------------
> arch/s390/kernel/setup.c | 1 +
> arch/s390/kernel/smp.c | 1 +
> 3 files changed, 6 insertions(+), 12 deletions(-)
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Vasily, can you pick this one up, please?
next prev parent reply other threads:[~2021-07-08 14:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-07 16:33 [PATCH] s390: preempt: Fix preempt_count initialization Valentin Schneider
2021-07-08 14:17 ` Heiko Carstens [this message]
2021-07-08 14:19 ` Vasily Gorbik
-- strict thread matches above, loose matches on Subject: below --
2021-07-07 19:42 Guenter Roeck
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=YOcI5iAZnHS9rtRT@osiris \
--to=hca@linux.ibm.com \
--cc=aik@ozlabs.ru \
--cc=borntraeger@de.ibm.com \
--cc=frederic@kernel.org \
--cc=gor@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=valentin.schneider@arm.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