diff options
author | Alexei Starovoitov <ast@kernel.org> | 2020-06-30 06:33:39 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-07-01 17:07:13 +0200 |
commit | bba1dc0b55ac462d24ed1228ad49800c238cd6d7 (patch) | |
tree | d83554930260fe70393ea2d74734357577035dce /kernel/bpf/queue_stack_maps.c | |
parent | selftests/bpf: Add byte swapping selftest (diff) | |
download | linux-bba1dc0b55ac462d24ed1228ad49800c238cd6d7.tar.xz linux-bba1dc0b55ac462d24ed1228ad49800c238cd6d7.zip |
bpf: Remove redundant synchronize_rcu.
bpf_free_used_maps() or close(map_fd) will trigger map_free callback.
bpf_free_used_maps() is called after bpf prog is no longer executing:
bpf_prog_put->call_rcu->bpf_prog_free->bpf_free_used_maps.
Hence there is no need to call synchronize_rcu() to protect map elements.
Note that hash_of_maps and array_of_maps update/delete inner maps via
sys_bpf() that calls maybe_wait_bpf_programs() and synchronize_rcu().
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Link: https://lore.kernel.org/bpf/20200630043343.53195-2-alexei.starovoitov@gmail.com
Diffstat (limited to 'kernel/bpf/queue_stack_maps.c')
-rw-r--r-- | kernel/bpf/queue_stack_maps.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/kernel/bpf/queue_stack_maps.c b/kernel/bpf/queue_stack_maps.c index 80c66a6d7c54..44184f82916a 100644 --- a/kernel/bpf/queue_stack_maps.c +++ b/kernel/bpf/queue_stack_maps.c @@ -101,13 +101,6 @@ static void queue_stack_map_free(struct bpf_map *map) { struct bpf_queue_stack *qs = bpf_queue_stack(map); - /* at this point bpf_prog->aux->refcnt == 0 and this map->refcnt == 0, - * so the programs (can be more than one that used this map) were - * disconnected from events. Wait for outstanding critical sections in - * these programs to complete - */ - synchronize_rcu(); - bpf_map_area_free(qs); } |