Skip to content

Commit 3fdb9eb

Browse files
committed
sched_ext: Start schedulers with consistent p->scx.slice values
The disable path caps p->scx.slice to SCX_SLICE_DFL. As the field is already being ignored at this stage during disable, the only effect this has is that when the next BPF scheduler is loaded, it won't see unreasonable left-over slices. Ultimately, this shouldn't matter but it's better to start in a known state. Drop p->scx.slice capping from the disable path and instead reset it to SCX_SLICE_DFL in the enable path. Signed-off-by: Tejun Heo <[email protected]> Acked-by: David Vernet <[email protected]>
1 parent 54baa7a commit 3fdb9eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched/ext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4473,7 +4473,6 @@ static void scx_ops_disable_workfn(struct kthread_work *work)
44734473

44744474
sched_deq_and_put_task(p, DEQUEUE_SAVE | DEQUEUE_MOVE, &ctx);
44754475

4476-
p->scx.slice = min_t(u64, p->scx.slice, SCX_SLICE_DFL);
44774476
__setscheduler_prio(p, p->prio);
44784477
check_class_changing(task_rq(p), p, old_class);
44794478

@@ -5190,6 +5189,7 @@ static int scx_ops_enable(struct sched_ext_ops *ops, struct bpf_link *link)
51905189

51915190
sched_deq_and_put_task(p, DEQUEUE_SAVE | DEQUEUE_MOVE, &ctx);
51925191

5192+
p->scx.slice = SCX_SLICE_DFL;
51935193
__setscheduler_prio(p, p->prio);
51945194
check_class_changing(task_rq(p), p, old_class);
51955195

0 commit comments

Comments
 (0)