]> Git Repo - linux.git/commitdiff
sched/fair: Fix update_cfs_group() vs DELAY_DEQUEUE
authorPeter Zijlstra <[email protected]>
Mon, 13 Jan 2025 12:50:11 +0000 (13:50 +0100)
committerPeter Zijlstra <[email protected]>
Mon, 13 Jan 2025 12:50:56 +0000 (13:50 +0100)
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: 152e11f6df29 ("sched/fair: Implement delayed dequeue")
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
kernel/sched/fair.c

index eeed8e34be9e430e08cdcfb8e441488ec1dd9651..26958431deb7a887f2518f70b0964631e344d132 100644 (file)
@@ -3956,7 +3956,11 @@ static void update_cfs_group(struct sched_entity *se)
        struct cfs_rq *gcfs_rq = group_cfs_rq(se);
        long shares;
 
-       if (!gcfs_rq)
+       /*
+        * When a group becomes empty, preserve its weight. This matters for
+        * DELAY_DEQUEUE.
+        */
+       if (!gcfs_rq || !gcfs_rq->load.weight)
                return;
 
        if (throttled_hierarchy(gcfs_rq))
This page took 0.163626 seconds and 4 git commands to generate.