


Struct bpf_array *array = container_of(map, struct bpf_array, map) Kernel/bpf/queue_stack_maps.c | 7 -ħ files changed, 3 insertions(+), 38 deletions(-)ĭiff -git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c Sys_bpf() that calls maybe_wait_bpf_programs() and synchronize_rcu(). Note that hash_of_maps and array_of_maps update/delete inner maps via Hence there is no need to call synchronize_rcu() to protect map elements. ` (4 subsequent siblings) 5 siblings, 1 reply 20+ messages in threadīpf_free_used_maps() or close(map_fd) will trigger map_free callback.īpf_free_used_maps() is called after bpf prog is no longer executing:īpf_prog_put->call_rcu->bpf_prog_free->bpf_free_used_maps. 4:33 ` bpf: Introduce sleepable BPF programs Alexei Starovoitov 4:33 bpf: Introduce minimal support for sleepable progs Alexei 4:33 ` Alexei Starovoitov

Only array and pre-allocated hash and lru maps allowed.Īrch/x86/net/bpf_jit_comp.c | 32 +++++.
Hashtab x64 Patch#
In this patch only fentry/fexit/fmod_ret and lsm progs can be sleepable. This patch set introduces the minimal viable support for sleepable bpf programs. Happy to confirm that rcu_trace overhead is negligible. Synchronize_rcu_tasks_trace() is not needed in free_map callbacks.Ġ.92% bench bpf_prog_740d4210cdcd99a3_bench_trigger_fentry_sleepĠ.26% bench _bpf_prog_exit_sleepableĠ.21% bench _bpf_prog_enter_sleepableĠ.79% bench bpf_prog_740d4210cdcd99a3_bench_trigger_fentry_sleepĠ.31% bench _bpf_prog_exit_sleepableĠ.29% bench _bpf_prog_enter_sleepableĠ.88% bench bpf_prog_740d4210cdcd99a3_bench_trigger_fentry fixed synchronize_rcu_tasks_trace() usage and accelerated with synchronize_rcu_mult(). To: davem +Cc: daniel, paulmck, netdev, bpf, kernel-team ` (5 more replies) 0 siblings, 6 replies 20+ messages in threadįrom: Alexei Starovoitov 4:33 UTC ( / raw) 4:33 ` bpf: Remove redundant synchronize_rcu Alexei Starovoitov
Hashtab x64 archive#
Bpf: Introduce minimal support for sleepable progs Netdev Archive on help / color / mirror / Atom feed * bpf: Introduce minimal support for sleepable progs 4:33 Alexei Starovoitov
