Re: [PATCH 3/5] sched/fair: Call update_curr() before unthrottling the hierarchy

From: Peter Zijlstra

Date: Mon Jun 01 2026 - 07:37:01 EST


On Mon, Jun 01, 2026 at 11:20:30AM +0530, K Prateek Nayak wrote:
> Hello Aaron,
>
> On 6/1/2026 9:22 AM, Aaron Lu wrote:
> >> 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().
>
> Woops! Completely missed that. Thank you for pointing it out. I'll
> add an update_rq_clock() there too once we grab the rq_lock.


Like this?

--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -9830,6 +9830,7 @@ static int tg_set_cfs_bandwidth(struct t
struct rq *rq = cfs_rq->rq;

guard(rq_lock_irq)(rq);
+ update_rq_clock();
cfs_rq->runtime_enabled = runtime_enabled;
cfs_rq->runtime_remaining = 1;