Re: [PATCH V6 2/6] sched/deadline: Deferrable dl server

From: Peter Zijlstra
Date: Thu May 02 2024 - 04:46:59 EST


On Thu, May 02, 2024 at 10:35:02AM +0200, Daniel Bristot de Oliveira wrote:
> On 4/10/24 19:47, Peter Zijlstra wrote:
> >> +static enum hrtimer_restart dl_server_timer(struct hrtimer *timer, struct sched_dl_entity *dl_se)
> >> +{
> >> + struct rq *rq = rq_of_dl_se(dl_se);
> >> + enum hrtimer_restart restart = 0;
> >> + struct rq_flags rf;
> >> + u64 fw;
> >> +
> >> + rq_lock(rq, &rf);
> > guard(rq_lock)(rq, &rf);
>
> this is the way I found to get the &rf... inspired on sched_rr_get_interval():
>
> scoped_guard (rq_lock, rq) {
> struct rq_flags *rf = &scope.rf;
>
> is that right?
>
Yeah, it's a bit ugly, but yes.