Re: [PATCH v2 1/2] sched/membarrier: Use per-CPU mutexes for targeted commands

From: Aniket Gattani

Date: Wed Apr 29 2026 - 20:12:14 EST


On Tue, Apr 28, 2026 at 2:48 PM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> > + if ((unsigned int)cpu_id >= nr_cpu_ids || !cpu_possible(cpu_id))
> > + return 0;
>
> Right, so this is broken, sorry about that. This makes the whole
> cpu_id == -1 branch below dead code, and that cannot be right.

Hi Peter,

Yikes! Thanks for catching that! I forgot that I placed the condition that way in the first place for the exact same reason.
I should have caught it myself.

I like your suggestion too and will incorporate it in v3.

Thanks,
Aniket