Skip to content

Commit edf1c58

Browse files
likewhatevshtejun
authored andcommitted
sched, sched_ext: Disable SM_IDLE/rq empty path when scx_enabled()
Disable the rq empty path when scx is enabled. SCX must consult the BPF scheduler (via the dispatch path in balance) to determine if rq is empty. This fixes stalls when scx is enabled. Signed-off-by: Pat Somaru <[email protected]> Fixes: 3dcac25 ("sched/core: Introduce SM_IDLE and an idle re-entry fast-path in __schedule()") Signed-off-by: Tejun Heo <[email protected]>
1 parent 7ebd84d commit edf1c58

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/sched/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6591,7 +6591,8 @@ static void __sched notrace __schedule(int sched_mode)
65916591
*/
65926592
prev_state = READ_ONCE(prev->__state);
65936593
if (sched_mode == SM_IDLE) {
6594-
if (!rq->nr_running) {
6594+
/* SCX must consult the BPF scheduler to tell if rq is empty */
6595+
if (!rq->nr_running && !scx_enabled()) {
65956596
next = prev;
65966597
goto picked;
65976598
}

0 commit comments

Comments
 (0)