]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
sched/fair: update_cfs_group() for throttled cfs_rqs
authorAaron Lu <ziqianlu@bytedance.com>
Wed, 10 Sep 2025 09:50:42 +0000 (17:50 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 15 Sep 2025 07:38:37 +0000 (09:38 +0200)
With task based throttle model, tasks in a throttled hierarchy are
allowed to continue to run if they are running in kernel mode. For this
reason, PELT clock is not stopped for these cfs_rqs in throttled
hierarchy when they still have tasks running or queued.

Since PELT clock is not stopped, whether to allow update_cfs_group()
doing its job for cfs_rqs which are in throttled hierarchy but still
have tasks running/queued is a question.

The good side is, continue to run update_cfs_group() can get these
cfs_rq entities with an up2date weight and that up2date weight can be
useful to derive an accurate load for the CPU as well as ensure fairness
if multiple tasks of different cgroups are running on the same CPU.
OTOH, as Benjamin Segall pointed: when unthrottle comes around the most
likely correct distribution is the distribution we had at the time of
throttle.

In reality, either way may not matter that much if tasks in throttled
hierarchy don't run in kernel mode for too long. But in case that
happens, let these cfs_rq entities have an up2date weight seems a good
thing to do.

Signed-off-by: Aaron Lu <ziqianlu@bytedance.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
kernel/sched/fair.c

index f993de30e14669e127573b8509f8f42139fc3595..58f5349d37256bf3e81dd0bdb77c30389f1533df 100644 (file)
@@ -3957,9 +3957,6 @@ static void update_cfs_group(struct sched_entity *se)
        if (!gcfs_rq || !gcfs_rq->load.weight)
                return;
 
-       if (throttled_hierarchy(gcfs_rq))
-               return;
-
        shares = calc_group_shares(gcfs_rq);
        if (unlikely(se->load.weight != shares))
                reweight_entity(cfs_rq_of(se), se, shares);