s390: preempt: Fix preempt_count initialization
Guenter Roeck
Tested-byQuoted 11 lines · Valentin Schneider
S390's
init_idle_preempt_count(p, cpu)doesn't actually let us initialize thepreempt_countof the requested CPU's idle task: it unconditionally writes to the current CPU's. This clearly conflicts withidle_threads_init(), which intends to initialize *all* the idle tasks, including theirpreempt_count(or their CPU's, if the arch uses a per-CPUpreempt_count).Unfortunately, it seems the way s390 does things doesn't let us initialize every possible CPU's
preempt_countearly on, as the pages where this resides are only allocated when a CPU is brought up and are freed when it is brought down.
Quoted 6 lines
Let the arch-specific code set a CPU's
preempt_countwhen its lowcore is allocated, and turninit_idle_preempt_count()into an empty stub.Fixes f1a0a376ca0c ("sched/core: Initialize the idle task with preemption disabled")Reported-by Guenter Roeck <[email protected]>Signed-off-by Valentin Schneider <[email protected]>
Tested-by Guenter Roeck <[email protected]>
Guenter