Re: [PATCH] smp: add a best_effort version of smp_call_function_many()

From: Randy Dunlap
Date: Mon Apr 19 2021 - 14:53:06 EST


Hi--

On 4/19/21 11:44 AM, Luigi Rizzo wrote:

>
> Signed-off-by: Luigi Rizzo <lrizzo@xxxxxxxxxx>
> ---
> include/linux/smp.h | 10 ++++++
> kernel/smp.c | 75 +++++++++++++++++++++++++++++++++++++--------
> 2 files changed, 72 insertions(+), 13 deletions(-)
>

> diff --git a/kernel/smp.c b/kernel/smp.c
> index aeb0adfa0606..75155875fadc 100644
> --- a/kernel/smp.c
> +++ b/kernel/smp.c

> @@ -693,8 +715,32 @@ static void smp_call_function_many_cond(const struct cpumask *mask,
> csd_lock_wait(csd);
> }
> }
> + return busy ? cfd->cpumask : NULL;
> }
>
> +/**
> + * Extended version of smp_call_function_many(). Same constraints.
> + * @mode == 0 same as wait = false, returns 0;
> + * @mode == 1 same as wait = true, returns 0;
> + * @mode = SMP_CFM_BEST_EFFORT: skips CPUs with previous pending requests,
> + * returns 0 and *mask unmodified if no CPUs are skipped,
> + * -EBUSY if CPUs are skipped, and *mask is the set of skipped CPUs

Please convert those comments to real kernel-doc format.
(Documentation/doc-guide/kernel-doc.rst)

> + */
> +int __smp_call_function_many(struct cpumask *mask, smp_call_func_t func,
> + void *info, int mode)
> +{

thanks.
--
~Randy