Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched/fair: update_cfs_group() for throttled cfs_rqs

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>

authored by

Aaron Lu and committed by
Peter Zijlstra
fcd39486 fe8d238e

-3
-3
kernel/sched/fair.c
··· 3957 3957 if (!gcfs_rq || !gcfs_rq->load.weight) 3958 3958 return; 3959 3959 3960 - if (throttled_hierarchy(gcfs_rq)) 3961 - return; 3962 - 3963 3960 shares = calc_group_shares(gcfs_rq); 3964 3961 if (unlikely(se->load.weight != shares)) 3965 3962 reweight_entity(cfs_rq_of(se), se, shares);