Patch "sched/fair: Add ancestors of unthrottled undecayed cfs_rq" has been added to the 5.14-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: Add ancestors of unthrottled undecayed cfs_rq

to the 5.14-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-add-ancestors-of-unthrottled-undecayed-cf.patch
and it can be found in the queue-5.14 subdirectory.

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



commit 829b2d95a87e9c0327337b33387bf842ca207a38
Author: Michal Koutný <mkoutny@xxxxxxxx>
Date:   Fri Sep 17 17:30:37 2021 +0200

    sched/fair: Add ancestors of unthrottled undecayed cfs_rq
    
    [ Upstream commit 2630cde26711dab0d0b56a8be1616475be646d13 ]
    
    Since commit a7b359fc6a37 ("sched/fair: Correctly insert cfs_rq's to
    list on unthrottle") we add cfs_rqs with no runnable tasks but not fully
    decayed into the load (leaf) list. We may ignore adding some ancestors
    and therefore breaking tmp_alone_branch invariant. This broke LTP test
    cfs_bandwidth01 and it was partially fixed in commit fdaba61ef8a2
    ("sched/fair: Ensure that the CFS parent is added after unthrottling").
    
    I noticed the named test still fails even with the fix (but with low
    probability, 1 in ~1000 executions of the test). The reason is when
    bailing out of unthrottle_cfs_rq early, we may miss adding ancestors of
    the unthrottled cfs_rq, thus, not joining tmp_alone_branch properly.
    
    Fix this by adding ancestors if we notice the unthrottled cfs_rq was
    added to the load list.
    
    Fixes: a7b359fc6a37 ("sched/fair: Correctly insert cfs_rq's to list on unthrottle")
    Signed-off-by: Michal Koutný <mkoutny@xxxxxxxx>
    Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
    Reviewed-by: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
    Reviewed-by: Odin Ugedal <odin@xxxxxxx>
    Link: https://lore.kernel.org/r/20210917153037.11176-1-mkoutny@xxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 30a6984a58f7..423ec671a306 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4898,8 +4898,12 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq)
 	/* update hierarchical throttle state */
 	walk_tg_tree_from(cfs_rq->tg, tg_nop, tg_unthrottle_up, (void *)rq);
 
-	if (!cfs_rq->load.weight)
+	/* Nothing to run but something to decay (on_list)? Complete the branch */
+	if (!cfs_rq->load.weight) {
+		if (cfs_rq->on_list)
+			goto unthrottle_throttle;
 		return;
+	}
 
 	task_delta = cfs_rq->h_nr_running;
 	idle_task_delta = cfs_rq->idle_h_nr_running;



[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