Re: [PATCH v3 1/9] smp: Run functions concurrently in smp_call_function_many()

From: Nadav Amit
Date: Mon Jul 22 2019 - 14:34:27 EST


> On Jul 22, 2019, at 11:21 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> On Thu, Jul 18, 2019 at 05:58:29PM -0700, Nadav Amit wrote:
>> +/*
>> + * Call a function on all processors. May be used during early boot while
>> + * early_boot_irqs_disabled is set.
>> + */
>> +static inline void on_each_cpu(smp_call_func_t func, void *info, int wait)
>> +{
>> + on_each_cpu_mask(cpu_online_mask, func, info, wait);
>> +}
>
> I'm thinking that one if buggy, nothing protects online mask here.

on_each_cpu_mask() calls __on_each_cpu_mask() which would disable preemption.
The mask might change, but anyhow __smp_call_function_many() would âandâ it,
after disabling preemption, with (the potentially updated) cpu_online_mask.

What is your concern?