Skip to content

Commit 66951e4

Browse files
author
Peter Zijlstra
committed
sched/fair: Fix update_cfs_group() vs DELAY_DEQUEUE
Normally dequeue_entities() will continue to dequeue an empty group entity; except DELAY_DEQUEUE changes things -- it retains empty entities such that they might continue to compete and burn off some lag. However, doing this results in update_cfs_group() re-computing the cgroup weight 'slice' for an empty group, which it (rightly) figures isn't much at all. This in turn means that the delayed entity is not competing at the expected weight. Worse, the very low weight causes its lag to be inflated, which combined with avg_vruntime() using scale_load_down(), leads to artifacts. As such, don't adjust the weight for empty group entities and let them compete at their original weight. Fixes: 152e11f ("sched/fair: Implement delayed dequeue") Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 6d71a9c commit 66951e4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

kernel/sched/fair.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3956,7 +3956,11 @@ static void update_cfs_group(struct sched_entity *se)
39563956
struct cfs_rq *gcfs_rq = group_cfs_rq(se);
39573957
long shares;
39583958

3959-
if (!gcfs_rq)
3959+
/*
3960+
* When a group becomes empty, preserve its weight. This matters for
3961+
* DELAY_DEQUEUE.
3962+
*/
3963+
if (!gcfs_rq || !gcfs_rq->load.weight)
39603964
return;
39613965

39623966
if (throttled_hierarchy(gcfs_rq))

0 commit comments

Comments
 (0)