diff options
author | 2022-09-02 14:10:47 -0700 | |
---|---|---|
committer | 2022-09-05 15:33:05 +0200 | |
commit | 34dd3bad1a6f1dc7d18ee8dd53f1d31bffd2aee8 (patch) | |
tree | 583d488e537f0938fb920c938bfecf5ef181bf85 /net/core/sock.c | |
parent | samples/bpf: Reduce syscall overhead in map_perf_test. (diff) | |
download | wireguard-linux-34dd3bad1a6f1dc7d18ee8dd53f1d31bffd2aee8.tar.xz wireguard-linux-34dd3bad1a6f1dc7d18ee8dd53f1d31bffd2aee8.zip |
bpf: Relax the requirement to use preallocated hash maps in tracing progs.
Since bpf hash map was converted to use bpf_mem_alloc it is safe to use
from tracing programs and in RT kernels.
But per-cpu hash map is still using dynamic allocation for per-cpu map
values, hence keep the warning for this map type.
In the future alloc_percpu_gfp can be front-end-ed with bpf_mem_cache
and this restriction will be completely lifted.
perf_event (NMI) bpf programs have to use preallocated hash maps,
because free_htab_elem() is using call_rcu which might crash if re-entered.
Sleepable bpf programs have to use preallocated hash maps, because
life time of the map elements is not protected by rcu_read_lock/unlock.
This restriction can be lifted in the future as well.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220902211058.60789-6-alexei.starovoitov@gmail.com
Diffstat (limited to 'net/core/sock.c')
0 files changed, 0 insertions, 0 deletions