https://github.com/torvalds/linux
Revision 6a942f5780545ebd11aca8b3ac4b163397962322 authored by Valentin Schneider on 07 July 2021, 16:33:38 UTC, committed by Vasily Gorbik on 08 July 2021, 20:12:18 UTC
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>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Link: https://lore.kernel.org/r/20210707163338.1623014-1-valentin.schneider@arm.com
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent 4ee471f
History
Tip revision: 6a942f5780545ebd11aca8b3ac4b163397962322 authored by Valentin Schneider on 07 July 2021, 16:33:38 UTC
s390: preempt: Fix preempt_count initialization
Tip revision: 6a942f5
File Mode Size
Makefile -rw-r--r-- 361 bytes
compat.c -rw-r--r-- 2.2 KB
ipc_sysctl.c -rw-r--r-- 6.1 KB
mq_sysctl.c -rw-r--r-- 2.7 KB
mqueue.c -rw-r--r-- 43.4 KB
msg.c -rw-r--r-- 31.6 KB
msgutil.c -rw-r--r-- 3.6 KB
namespace.c -rw-r--r-- 5.1 KB
sem.c -rw-r--r-- 62.9 KB
shm.c -rw-r--r-- 43.0 KB
syscall.c -rw-r--r-- 5.1 KB
util.c -rw-r--r-- 23.7 KB
util.h -rw-r--r-- 8.9 KB

back to top