Re: [PATCH bpf-next v2 19/26] bpf: Convert hashtab.c to rqspinlock

Alexei Starovoitov
2025-02-08T02:01:29Z

On Thu, Feb 6, 2025 at 2:55 AM Kumar Kartikeya Dwivedi <memxor@gmail.com> wrote:
>
> Convert hashtab.c from raw_spinlock to rqspinlock, and drop the hashed
> per-cpu counter crud from the code base which is no longer necessary.
>
> Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
> ---
> kernel/bpf/hashtab.c | 102 ++++++++++++++-----------------------------
> 1 file changed, 32 insertions(+), 70 deletions(-)
>
> diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c
> index 4a9eeb7aef85..9b394e147967 100644
> --- a/kernel/bpf/hashtab.c
> +++ b/kernel/bpf/hashtab.c
> @@ -16,6 +16,7 @@
> #include "bpf_lru_list.h"
> #include "map_in_map.h"
> #include <linux/bpf_mem_alloc.h>
> +#include <asm/rqspinlock.h>
>
> #define HTAB_CREATE_FLAG_MASK \
> (BPF_F_NO_PREALLOC | BPF_F_NO_COMMON_LRU | BPF_F_NUMA_NODE | \
> @@ -78,7 +79,7 @@
> */
> struct bucket {
> struct hlist_nulls_head head;
> - raw_spinlock_t raw_lock;
> + rqspinlock_t raw_lock;

Pls add known syzbot reports as 'Closes:' to commit log.