Skip to content

Commit 563bc21

Browse files
dtccccPeter Zijlstra
authored andcommitted
sched/eevdf: Force propagating min_slice of cfs_rq when {en,de}queue tasks
When a task is enqueued and its parent cgroup se is already on_rq, this parent cgroup se will not be enqueued again, and hence the root->min_slice leaves unchanged. The same issue happens when a task is dequeued and its parent cgroup se has other runnable entities, and the parent cgroup se will not be dequeued. Force propagating min_slice when se doesn't need to be enqueued or dequeued. Ensure the se hierarchy always get the latest min_slice. Fixes: aef6987 ("sched/eevdf: Propagate min_slice up the cgroup hierarchy") Signed-off-by: Tianchen Ding <dtcccc@linux.alibaba.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20250211063659.7180-1-dtcccc@linux.alibaba.com
1 parent b9f2b29 commit 563bc21

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

kernel/sched/fair.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7002,6 +7002,8 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
70027002
update_cfs_group(se);
70037003

70047004
se->slice = slice;
7005+
if (se != cfs_rq->curr)
7006+
min_vruntime_cb_propagate(&se->run_node, NULL);
70057007
slice = cfs_rq_min_slice(cfs_rq);
70067008

70077009
cfs_rq->h_nr_runnable += h_nr_runnable;
@@ -7131,6 +7133,8 @@ static int dequeue_entities(struct rq *rq, struct sched_entity *se, int flags)
71317133
update_cfs_group(se);
71327134

71337135
se->slice = slice;
7136+
if (se != cfs_rq->curr)
7137+
min_vruntime_cb_propagate(&se->run_node, NULL);
71347138
slice = cfs_rq_min_slice(cfs_rq);
71357139

71367140
cfs_rq->h_nr_runnable -= h_nr_runnable;

0 commit comments

Comments
 (0)