Re: [RFC][PATCH 4/6] sched: Fold sched_class::switch{ing,ed}_{to,from}() into the change pattern

From: Tejun Heo
Date: Wed Oct 30 2024 - 17:46:21 EST


Hello,

On Wed, Oct 30, 2024 at 10:37:35PM +0100, Peter Zijlstra wrote:
> On Wed, Oct 30, 2024 at 11:29:09AM -1000, Tejun Heo wrote:
> > On Wed, Oct 30, 2024 at 10:15:06PM +0100, Peter Zijlstra wrote:
> > ...
> > > > > + if (!(queue_flags & DEQUEUE_CLASS))
> > > > > + check_prio_changed(task_rq(p), p, p->prio);
> > > >
> > > > Maybe prio_changed can be moved into scoped_guard?
> > >
> > > It wasn't before -- do you have need for it to be inside?
> >
> > No, was just wondering whether that'd make things a bit more compact. Either
> > way is fine.
>
> Oh, did you perhaps mean into sched_change_end() ? I suppose that's
> possible indeed. Initially I thought that would require yet another

Oh yeah, that's what I meant. Sorry about not being clearer.

> flags, but looking at it again, that doesn't seem to be the case. All
> sched_change users lacking it never change the prio anyway.
>
> I'll have a look at doing that tomorrow, with a slightly fresher brain.
>
> I also think that adding flags to the switch*() methods isn't at all
> needed, but perhaps it makes sense anyway.

Fantastic. Thanks.

--
tejun