Re: [PATCH v3 02/12] smp: Enable preemption early in smp_call_function_single
From: Chuyi Zhou
Date: Wed Mar 18 2026 - 22:32:46 EST
Hi Steve,
在 2026/3/18 22:14, Steven Rostedt 写道:
> On Wed, 18 Mar 2026 12:56:28 +0800
> "Chuyi Zhou" <zhouchuyi@xxxxxxxxxxxxx> wrote:
>
>> diff --git a/kernel/smp.c b/kernel/smp.c
>> index fc1f7a964616..b603d4229f95 100644
>> --- a/kernel/smp.c
>> +++ b/kernel/smp.c
>> @@ -685,11 +685,16 @@ int smp_call_function_single(int cpu, smp_call_func_t func, void *info,
>>
>> err = generic_exec_single(cpu, csd);
>>
>> + /*
>> + * @csd is stack-allocated when @wait is true. No concurrent access
>> + * except from the IPI completion path, so we can re-enable preemption
>> + * early to reduce latency.
>> + */
>
> Thanks for the comment. I walked through the code and this looks fine to me.
>
>> + put_cpu();
>> +
>> if (wait)
>> csd_lock_wait(csd);
>>
>> - put_cpu();
>> -
>> return err;
>
> Reviewed-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
>
Thanks!
> -- Steve