Re: [PATCH v3 4/5] sched/fair: Task based throttle time accounting
From: Valentin Schneider
Date: Tue Aug 19 2025 - 10:11:41 EST
On 19/08/25 17:34, Aaron Lu wrote:
> On Mon, Aug 18, 2025 at 04:57:27PM +0200, Valentin Schneider wrote:
>> On 15/07/25 15:16, Aaron Lu wrote:
>> Apologies if this has been discussed before.
>>
>> So the throttled time (as reported by cpu.stat.local) is now accounted as
>> the time from which the first task in the hierarchy gets effectively
>> throttled - IOW the first time a task in a throttled hierarchy reaches
>> resume_user_mode_work() - as opposed to as soon as the hierarchy runs out
>> of quota.
>
> Right.
>
>>
>> The gap between the two shouldn't be much, but that should at the very
>> least be highlighted in the changelog.
>>
>
> Got it, does the below added words make this clear?
>
Yes, thank you. Small corrections below.
> With task based throttle model, the previous way to check cfs_rq's
> nr_queued to decide if throttled time should be accounted doesn't work
> as expected, e.g. when a cfs_rq which has a single task is throttled,
> that task could later block in kernel mode instead of being dequeued on
> limbo list and account this as throttled time is not accurate.
^^^^^^
accounting
>
> Rework throttle time accounting for a cfs_rq as follows:
> - start accounting when the first task gets throttled in its hierarchy;
> - stop accounting on unthrottle.
>
> Note that there will be a time gap between when a cfs_rq is throttled
> and when a task in its hierarchy is actually throttled. This accounting
> mechanism only started accounting in the latter case.
^^^^^^
starts