Re: [PATCH] sched/fair: Restore RCU read lock in set_cpu_sd_state_{busy,idle}()

From: Andrea Righi

Date: Fri May 22 2026 - 01:18:32 EST


On Fri, May 22, 2026 at 09:44:15AM +0530, K Prateek Nayak wrote:
> Hello Andrea,
>
> On 5/22/2026 2:21 AM, Andrea Righi wrote:
> > @@ -14070,6 +14070,8 @@ static void nohz_balancer_kick(struct rq *rq)
> > static void set_cpu_sd_state_busy(int cpu)
> > {
> > struct sched_domain *sd;
> > +
> > + rcu_read_lock();
>
> guard(rcu)() saves on the need for an unlock label but this works fine
> too. Feel free to include:
>
> Reviewed-by: K Prateek Nayak <kprateek.nayak@xxxxxxx>

Ah yes, could be a good opportunity to switch to guard(rcu)(), I'll send a v2.

Thanks,
-Andrea

>
> > sd = rcu_dereference_all(per_cpu(sd_llc, cpu));
> >
> > /*
> --
> Thanks and Regards,
> Prateek
>