Re: [PATCH v25 8/9] sched: Move attach_one_task and attach_task helpers to sched.h

From: John Stultz

Date: Mon Mar 16 2026 - 19:35:39 EST


On Sun, Mar 15, 2026 at 9:34 AM K Prateek Nayak <kprateek.nayak@xxxxxxx> wrote:
> On 3/13/2026 8:00 AM, John Stultz wrote:
> > +/*
> > + * attach_one_task() -- attaches the task returned from detach_one_task() to
> > + * its new rq.
> > + */
> > +static inline void attach_one_task(struct rq *rq, struct task_struct *p)
> > +{
> > + struct rq_flags rf;
> > +
> > + rq_lock(rq, &rf);
>
> nit. We can now use guard(rq_lock)(rq) and save on needing to declare a
> "rf". Apart from that, feel free to include:

I actually did this in a later patch in the full series, as it seemed
more clear I wasn't modifying logic when moving the code:
https://github.com/johnstultz-work/linux-dev/commit/8d8a12278d81ce81af6b0dfd051750f4ce2ec0e5

But, given your feedback, I'll go ahead and fold that fix down to this
change and add a note in the commit message.

Thanks as always for the review and feedback!
-john