Re: [PATCH] padata: fix lockdep warning in padata_find_next()

From: Bradley Morgan

Date: Tue Nov 03 2026 - 08:02:47 EST


On 2 November 2026 15:53:53 GMT, Tristan Madani <tristmd@xxxxxxxxx> wrote:
>padata_find_next() acquires reorder->lock while the caller
>padata_reorder() already holds squeue->serial.lock. Both locks are of
>type struct padata_list and thus share the same lockdep class, which
>triggers a false positive recursive locking warning even though the two
>instances always protect different data.
>
>Annotate the inner lock with spin_lock_nested() to tell lockdep about
>the valid nesting.
>
>Fixes: 16295bec6398 ("padata: Generic parallelization/serialization interface")
>Cc: stable@xxxxxxxxxxxxxxx
>Signed-off-by: Tristan Madani <tristan@xxxxxxxxxxxxxxxxxxx>
>---
> kernel/padata.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/kernel/padata.c b/kernel/padata.c
>index 0d3ea1b68b1f7..2f769ba7dfa99 100644
>--- a/kernel/padata.c
>+++ b/kernel/padata.c
>@@ -253,7 +253,7 @@ static struct padata_priv *padata_find_next(struct parallel_data *pd, int cpu,
>
> reorder = per_cpu_ptr(pd->reorder_list, cpu);
>
>- spin_lock(&reorder->lock);
>+ spin_lock_nested(&reorder->lock, SINGLE_DEPTH_NESTING);

I'll bite.

Reviewed-by: Bradley Morgan <brads@xxxxxxxxxxxxxx>


> if (list_empty(&reorder->list))
> goto notfound;
>
>

--- Thanks!