[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <878qmkr0u3.ffs@tglx>
Date: Sun, 25 May 2025 20:40:04 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: markus.stockhausen@....de, tsbogend@...ha.franken.de,
linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org,
s.gottschall@...wrt.com
Subject: Re: AW: [PATCH] irqchip/mips-gic: allow forced affinity for current
cpu during hotplug
On Sun, May 25 2025 at 11:43, markus stockhausen wrote:
>> Von: Thomas Gleixner <tglx@...utronix.de>
>>
>> On Fri, May 23 2025 at 11:15, Markus Stockhausen wrote:
>> > +
>> > + if ((cpu >= NR_CPUS) && !force)
>> > + /* In normal mode allow only online CPUs. */
>> > return -EINVAL;
>> >
>> > + if (cpu >= NR_CPUS) {
>> > + /* In force mode allow current not yet online CPU for
> hotplug handlers. */
>> > + cpu = cpumask_first(cpumask);
>> > + if (cpu != get_cpu())
>> > + return -EINVAL;
>> > + }
>>
>> This logic really makes my brain hurt. Why not doing the obvious:
>>
>> if (cpu >= NR_CPUS) {
>> /* Sensible comment */
>> if (!force)
>> return -EINVAL;
>> ...
>> }
>
> Then what about an even more relaxed and cleaner version like in other
> drivers?
>
> If (force)
> cpu = cpumask_first(cpumask);
> else
> cpu = cpumask_first_and(cpumask, cpu_online_mask);
Fine with me.
Powered by blists - more mailing lists