sched/fair: Fix update_cfs_group() vs DELAY_DEQUEUE
[ Upstream commit66951e4860] 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:152e11f6df("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 Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d01a7e05ea
commit
e98394f7bc
+5
-1
@@ -4065,7 +4065,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))
|
||||
|
||||
Reference in New Issue
Block a user