Re: [PATCH bpf v2 1/4] rhashtable: Add trylock_irqsoff for callers that can't spin

From: bot+bpf-ci

Date: Sun Nov 22 2026 - 19:58:27 EST


> rhashtable: Add trylock_irqsoff for callers that can't spin

TL;DR: Nits only: documentation gaps. The new -EBUSY return isn't in the
remove kernel-doc, and the member doc omits UP always returning -EBUSY with
IRQs off.

> diff --git a/include/linux/rhashtable-types.h b/include/linux/rhashtable-types.h
> --- a/include/linux/rhashtable-types.h
> +++ b/include/linux/rhashtable-types.h
> @@ -52,6 +52,8 @@ typedef int (*rht_obj_cmpfn_t)(struct rhashtable_compare_arg *arg,
> * @min_size: Minimum size while shrinking
> * @insecure_elasticity: Set to true to disable chain length checks
> * @automatic_shrinking: Enable automatic shrinking of tables
> + * @trylock_irqsoff: With irqs disabled insert and remove don't spin on
> + * the bucket lock and return -EBUSY

This isn't a bug, but should this member doc also say that on UP without
CONFIG_DEBUG_SPINLOCK these calls always return -EBUSY when IRQs are
disabled? Only the commit message mentions it.

[ ... ]

> diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h
> --- a/include/linux/rhashtable.h
> +++ b/include/linux/rhashtable.h

[ ... ]

> @@ -1066,7 +1094,8 @@ static __always_inline int __rhashtable_remove_fast_one(
> if (!bkt)
> return -ENOENT;
> pprev = NULL;
> - flags = rht_lock(tbl, bkt);
> + if (!rht_lock_or_busy(tbl, bkt, params, &flags))
> + return -EBUSY;

This isn't a bug, but rhashtable_remove_fast() and rhltable_remove() can now
return -EBUSY through this path, and their kernel-doc still says:

* Returns zero on success, -ENOENT if the entry could not be found.

Should the Returns lines mention -EBUSY when params.trylock_irqsoff is set?

[ ... ]

---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/45090312341