Re: [PATCH 1/7] stop_machine: Introduce stop_machine_nmi()
From: Thomas Gleixner
Date: Fri Jan 30 2026 - 05:02:44 EST
On Thu, Jan 29 2026 at 09:07, Chang S. Bae wrote:
> On 1/28/2026 12:02 AM, Thomas Gleixner wrote:
>> And this wants to become
>>
>> if (IS_ENABLED(CONFIG_STOMP_MACHINE_NMI) && msdata->use_nmi)
>> err = stop_this_cpu_nmi(msdata);
>> else
>> err = msdata->fn(msdata->data);
>
> Although that config option is very clear and makes tons of sense, the
> latter reads like a (silent) fallback path for a stop_machine_nmi()
> invocation with CONFIG_STOMP_MACHINE_NMI=n.
>
> Maybe this might be clear to reject the NMI option right away with
> something like:
>
> stop_machine_cpuslocked_nmi(...)
> {
> if (!IS_ENABLED(CONFIG_STOMP_MACHINE_NMI))
> return -EOPNOTSUPP;
> ...
> };
That function should not be exposed at all when the config switch is
off. Hide it behind #ifdef CONFIG...
It really should not be used in generic code at all.
Thanks,
tglx