]> git.ipfire.org Git - thirdparty/linux.git/commit
bpf: Change local_storage->lock and b->lock to rqspinlock
authorAmery Hung <ameryhung@gmail.com>
Thu, 5 Feb 2026 22:29:03 +0000 (14:29 -0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Fri, 6 Feb 2026 22:29:04 +0000 (14:29 -0800)
commit8dabe34b9d5b1135b084268396ed2267107e64c1
tree0dab4d2407744df7b26f7f708831eae0fa2a062e
parent403e935f915896243ff93f9a2ff44e5bb6619032
bpf: Change local_storage->lock and b->lock to rqspinlock

Change bpf_local_storage::lock and bpf_local_storage_map_bucket::lock
from raw_spin_lock to rqspinlock.

Finally, propagate errors from raw_res_spin_lock_irqsave() to syscall
return or BPF helper return.

In bpf_local_storage_destroy(), ignore return from
raw_res_spin_lock_irqsave() for now. A later patch will correctly
handle errors correctly in bpf_local_storage_destroy() so that it can
unlink selems even when failing to acquire locks.

For __bpf_local_storage_map_cache(), instead of handling the error,
skip updating the cache.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Amery Hung <ameryhung@gmail.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20260205222916.1788211-6-ameryhung@gmail.com
include/linux/bpf_local_storage.h
kernel/bpf/bpf_local_storage.c