Re: [RFC PATCH] smp: Evaluate local cond_func() before IPI side-effects
From: Rik van Riel
Date: Tue Dec 03 2024 - 12:30:18 EST
On Tue, 2024-12-03 at 11:35 -0500, Mathieu Desnoyers wrote:
> In smp_call_function_many_cond(), the local cond_func() is evaluated
> after triggering the remote CPU IPIs.
>
> If cond_func() depends on loading shared state updated by other CPU's
> IPI handlers func(), then triggering execution of remote CPUs IPI
> before
> evaluating cond_func() may have unexpected consequences.
>
> One example scenario is evaluating a jiffies delay in cond_func(),
> which
> is updated by func() in the IPI handlers. This situation can prevent
> execution of periodic cleanup code on the local CPU.
>
> Link: https://lore.kernel.org/lkml/20241202202213.26a79ed6@fangorn/
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
>
Reviewed-by: Rik van Riel <riel@xxxxxxxxxxx>
--
All Rights Reversed.