Patch "sched/fair: Fix update_cfs_group() vs DELAY_DEQUEUE" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    sched/fair: Fix update_cfs_group() vs DELAY_DEQUEUE

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sched-fair-fix-update_cfs_group-vs-delay_dequeue.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 21dbeb9d8096a5f19b1a69347dc518e95a9e3782
Author: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Date:   Mon Jan 13 13:50:11 2025 +0100

    sched/fair: Fix update_cfs_group() vs DELAY_DEQUEUE
    
    [ Upstream commit 66951e4860d3c688bfa550ea4a19635b57e00eca ]
    
    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@xxxxxxxxxxxxx>
    Link: https://lkml.kernel.org/r/20250110115720.GA17405@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index bf8153af96879..7f8677ce83f9f 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -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))




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux