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

K Prateek Nayak
2026-03-15T16:34:46Z

Hello John,

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:

Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>

> + update_rq_clock(rq);
> + attach_task(rq, p);
> + rq_unlock(rq, &rf);
> +}
> +
--
Thanks and Regards,
Prateek