]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf: no longer acquire map_idr_lock in bpf_map_inc_not_zero()
authorEric Dumazet <edumazet@google.com>
Sat, 1 Mar 2025 19:13:15 +0000 (19:13 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 15 Mar 2025 18:48:26 +0000 (11:48 -0700)
commitf8ac5a4e1a97354c9a076e9a0c289032618a4f56
treecc6efbdf1a6c52613a25653de202b7b5939211fb
parentdd4d3ef3c50229d981ab547f5ce8d6fa692e1577
bpf: no longer acquire map_idr_lock in bpf_map_inc_not_zero()

bpf_sk_storage_clone() is the only caller of bpf_map_inc_not_zero()
and is holding rcu_read_lock().

map_idr_lock does not add any protection, just remove the cost
for passive TCP flows.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Kui-Feng Lee <kuifeng@meta.com>
Cc: Martin KaFai Lau <martin.lau@kernel.org>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://lore.kernel.org/r/20250301191315.1532629-1-edumazet@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/syscall.c