Commit c87488a
sched/ext: convert scx_tasks_lock to raw spinlock
Update scx_task_locks so that it's safe to lock/unlock in a
non-sleepable context in PREEMPT_RT kernels. scx_task_locks is
(non-raw) spinlock used to protect the list of tasks under SCX.
This list is updated during from finish_task_switch(), which
cannot sleep. Regular spinlocks can be locked in such a context
in non-RT kernels, but are sleepable under when CONFIG_PREEMPT_RT=y.
Convert scx_task_locks into a raw spinlock, which is not sleepable
even on RT kernels.
Sample backtrace:
<TASK>
dump_stack_lvl+0x83/0xa0
__might_resched+0x14a/0x200
rt_spin_lock+0x61/0x1c0
? sched_ext_dead+0x2d/0xf0
? lock_release+0xc6/0x280
sched_ext_dead+0x2d/0xf0
? srso_alias_return_thunk+0x5/0xfbef5
finish_task_switch.isra.0+0x254/0x360
__schedule+0x584/0x11d0
? srso_alias_return_thunk+0x5/0xfbef5
? srso_alias_return_thunk+0x5/0xfbef5
? tick_nohz_idle_exit+0x7e/0x120
schedule_idle+0x23/0x40
cpu_startup_entry+0x29/0x30
start_secondary+0xf8/0x100
common_startup_64+0x13e/0x148
</TASK>
Signed-off-by: Emil Tsalapatis <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>1 parent 5f02151 commit c87488a
1 file changed
+8
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
479 | | - | |
| 479 | + | |
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
| |||
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
510 | | - | |
| 510 | + | |
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
517 | | - | |
| 517 | + | |
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
| |||
2940 | 2940 | | |
2941 | 2941 | | |
2942 | 2942 | | |
2943 | | - | |
| 2943 | + | |
2944 | 2944 | | |
2945 | | - | |
| 2945 | + | |
2946 | 2946 | | |
2947 | 2947 | | |
2948 | 2948 | | |
| |||
2966 | 2966 | | |
2967 | 2967 | | |
2968 | 2968 | | |
2969 | | - | |
| 2969 | + | |
2970 | 2970 | | |
2971 | | - | |
| 2971 | + | |
2972 | 2972 | | |
2973 | 2973 | | |
2974 | 2974 | | |
| |||
0 commit comments