Re: [PATCH] padata: Reset next CPU when reorder sequence wraps around

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> diff --git a/kernel/padata.c b/kernel/padata.c
> index 7eee94166357..ebb52c6db637 100644
> --- a/kernel/padata.c
> +++ b/kernel/padata.c
> @@ -290,7 +290,11 @@ static struct padata_priv *padata_find_next(struct parallel_data *pd,
>         if (remove_object) {
>                 list_del_init(&padata->list);
>                 ++pd->processed;
> -               pd->cpu = cpumask_next_wrap(cpu, pd->cpumask.pcpu);
> +               /* When sequence wraps around, reset to the first CPU. */
> +               if (unlikely(pd->processed == 0))
> +                       pd->cpu = cpumask_first(pd->cpumask.pcpu);
> +               else
> +                       pd->cpu = cpumask_next_wrap(cpu, pd->cpumask.pcpu);
>         }
>
>         spin_unlock(&reorder->lock);
> --
> 2.50.0
>

Another question:
Do we even need a per-CPU reorder_list? It's always used
with a remote CPU id and spin-lock. Would a plain array of
struct padata_list be sufficient?




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux