sched/fair: Fix update_cfs_group() vs DELAY_DEQUEUE
authorPeter Zijlstra <peterz@infradead.org>
Mon, 13 Jan 2025 12:50:11 +0000 (13:50 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 13 Jan 2025 12:50:56 +0000 (13:50 +0100)
commit66951e4860d3c688bfa550ea4a19635b57e00eca
tree586707e75608cd854d7f7acd276cd4f590b7ba32
parent6d71a9c6160479899ee744d2c6d6602a191deb1f
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: 152e11f6df29 ("sched/fair: Implement delayed dequeue")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20250110115720.GA17405@noisy.programming.kicks-ass.net
kernel/sched/fair.c