Re: [PATCH v8 07/14] smp: Remove preempt_disable() from smp_call_function()
From: Thomas Gleixner
Date: Fri Jun 26 2026 - 10:47:22 EST
On Tue, Jun 16 2026 at 19:11, Chuyi Zhou wrote:
> Now smp_call_function_many_cond() internally handles the preemption logic,
> so smp_call_function() does not need to explicitly disable preemption.
> Remove preempt_{enable, disable} from smp_call_function().
Add a new line before the last sentence and this becomes a nice and good
change log.
> Signed-off-by: Chuyi Zhou <zhouchuyi@xxxxxxxxxxxxx>
> Reviewed-by: Muchun Song <muchun.song@xxxxxxxxx>
> Reviewed-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
> Tested-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
> ---
> kernel/smp.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/smp.c b/kernel/smp.c
> index 390e6526574c..096d857dc3a5 100644
> --- a/kernel/smp.c
> +++ b/kernel/smp.c
> @@ -1012,9 +1012,8 @@ EXPORT_SYMBOL(smp_call_function_many);
> */
> void smp_call_function(smp_call_func_t func, void *info, int wait)
> {
> - preempt_disable();
> - smp_call_function_many(cpu_online_mask, func, info, wait);
> - preempt_enable();
> + smp_call_function_many_cond(cpu_online_mask, func, info,
> + wait ? SCF_WAIT : 0, NULL);
Again. If you need a line break align the second line argument with the
first argument of the line above. It's documented coding style.