Re: [RFC PATCH 3/6] smp: Run functions concurrently in smp_call_function_many()

From: Nadav Amit
Date: Mon May 27 2019 - 13:43:14 EST


> On May 27, 2019, at 2:15 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
>> + /*
>> + * Choose the most efficient way to send an IPI. Note that the
>> + * number of CPUs might be zero due to concurrent changes to the
>> + * provided mask or cpu_online_mask.
>> + */
>
> Since we have preemption disabled here, I don't think online mask can
> shrink, cpu-offline uses stop_machine().

Right. So Iâll update the comment, but IIUC the provided mask might still
change, so Iâll leave the rest of the comment and the code as is.

>> + if (nr_cpus == 1)
>> + arch_send_call_function_single_ipi(last_cpu);
>> + else if (likely(nr_cpus > 1))
>> + arch_send_call_function_ipi_mask(cfd->cpumask_ipi);
>> + }