aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/tcpbpf_user.c
diff options
context:
space:
mode:
authorSong Liu <songliubraving@fb.com>2020-10-29 00:19:25 -0700
committerAlexei Starovoitov <ast@kernel.org>2020-10-30 13:03:29 -0700
commit20b6cc34ea74b6a84599c1f8a70f3315b56a1883 (patch)
treed3a5f38e379c3a12c5592aeec15e1806e9a26403 /tools/testing/selftests/bpf/prog_tests/tcpbpf_user.c
parentc50eb518e262fa06bd334e6eec172eaf5d7a5bd9 (diff)
bpf: Avoid hashtab deadlock with map_locked
If a hashtab is accessed in both non-NMI and NMI context, the system may deadlock on bucket->lock. Fix this issue with percpu counter map_locked. map_locked rejects concurrent access to the same bucket from the same CPU. To reduce memory overhead, map_locked is not added per bucket. Instead, 8 percpu counters are added to each hashtab. buckets are assigned to these counters based on the lower bits of its hash. Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20201029071925.3103400-3-songliubraving@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/tcpbpf_user.c')
0 files changed, 0 insertions, 0 deletions