Re: [RESEND PATCH v5 04/12] smp: Use task-local IPI cpumask in smp_call_function_many_cond()
From: Sebastian Andrzej Siewior
Date: Thu May 21 2026 - 12:06:11 EST
On 2026-05-13 20:45:16 [+0800], Chuyi Zhou wrote:
> diff --git a/kernel/smp.c b/kernel/smp.c
> index 9e9dab3b0d51..630c8e5a635d 100644
> --- a/kernel/smp.c
> +++ b/kernel/smp.c
> @@ -811,11 +849,18 @@ static void smp_call_function_many_cond(const struct cpumask *mask,
> int cpu, last_cpu, this_cpu = smp_processor_id();
> struct call_function_data *cfd;
> bool wait = scf_flags & SCF_WAIT;
> + struct cpumask *cpumask, *task_mask;
> + bool preemptible_wait;
> int nr_cpus = 0;
> bool run_remote = false;
>
> lockdep_assert_preemption_disabled();
>
> + task_mask = smp_task_ipi_mask(current);
> + preemptible_wait = task_mask;
> + cfd = this_cpu_ptr(&cfd_data);
> + cpumask = preemptible_wait ? task_mask : cfd->cpumask;
Is this a porting artifact? preemptible_wait is a bool while task_mask
is a pointer which is always != NULL.
UP to here the patches and the code made sense.
> +
> /*
> * Can deadlock when called with interrupts disabled.
> * We allow cpu's that are not yet online though, as no one else can
Sebastian