Re: [PATCH v3] sched: async unthrottling for cfs bandwidth
From: Josh Don
Date: Tue Nov 22 2022 - 14:41:26 EST
> > + */
> > + if (local_unthrottle) {
> > + rq = cpu_rq(this_cpu);
> > + rq_lock_irqsave(rq, &rf);
>
> Should we add:
> if (cfs_rq_throttled(local_unthrottle))
>
> before calling into unthrottle_cfs_rq_async(local_unthrottle) to avoid a
> potential WARN?
>
> As for whether the local cfs_rq can be unthrottled now after rq lock is
> re-acquired, I suppose it can be. e.g. another user sets a new quota to
> this task group during the window of rq lock gets dropped in the above
> loop and re-acquired here IIUC.
>
> > + unthrottle_cfs_rq_async(local_unthrottle);
> > + rq_unlock_irqrestore(rq, &rf);
> > + }
> > +
> > return throttled;
> > }
Yes, we should add that check due to the case you described with a
user concurrently configuring bandwidth. And as long as we're doing
that, we might as well make this unthrottle_cfs_rq() instead and snip
the comment. Peter, would you mind adding that delta?