sched: Replace rq::wake_list
The recent commit: 90b5363a ("sched: Clean up scheduler_ipi()") got smp_call_function_single_async() subtly wrong. Even though it will return -EBUSY when trying to re-use a csd, that condition is not atomic and still requires external serialization. The change in ttwu_queue_remote() got this wrong. While on first reading ttwu_queue_remote() has an atomic test-and-set that appears to serialize the use, the matching 'release' is not in the right place to actually guarantee this serialization. The actual race is vs the sched_ttwu_pending() call in the idle loop; that can run the wakeup-list without consuming the CSD. Instead of trying to chain the lists, merge them. Signed-off-by:Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by:
Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20200526161908.129371594@infradead.org
Showing
- include/linux/sched.h 1 addition, 0 deletionsinclude/linux/sched.h
- include/linux/smp.h 1 addition, 0 deletionsinclude/linux/smp.h
- kernel/sched/core.c 7 additions, 18 deletionskernel/sched/core.c
- kernel/sched/idle.c 0 additions, 1 deletionkernel/sched/idle.c
- kernel/sched/sched.h 0 additions, 8 deletionskernel/sched/sched.h
- kernel/smp.c 40 additions, 7 deletionskernel/smp.c
Loading
Please register or sign in to comment