Re: [PATCH 3/5] sched/fair: Call update_curr() before unthrottling the hierarchy
From: Aaron Lu
Date: Sun May 31 2026 - 23:52:55 EST
Hi Prateek,
On Thu, May 28, 2026 at 09:48:28AM +0000, K Prateek Nayak wrote:
> Subsequent commits will allow update_curr() to throttle the hierarchy
> when the runtime accounting exceeds allocated quota. Call update_curr()
> before the unthrottle event, and in tg_unthrottle_up() to catch up on
> any remaining runtime and stabilize the "runtime_remaining" and
> "throttle_count" for that cfs_rq.
>
> Doing an update_curr() early ensures the cfs_rq is not throttled right
> back up again when the unthrottle is in progress.
>
> Since all callers of unthrottle_cfs_rq(), except one, already update the
> rq_clock and call rq_clock_start_loop_update(), move the
> update_rq_clock() in unthrottle_cfs_rq() to the lonely caller that
> doesn't update the rq_clock.
Looks like there is one more path that doesn't have clock updated:
cpu_max_write() -> tg_set_bandwidth() -> tg_set_cfs_bandwidth() ->
unthrottle_cfs_rq().