Re: [PATCH v4 bpf-next 1/5] bpf: Remove redundant synchronize_rcu.

From
Andrii Nakryiko <hidden>
Date
2020-06-30 00:58:51
Also in
bpf
Reply to
Alexei Starovoitov, 2020-06-30
On Mon, Jun 29, 2020 at 5:35 PM Alexei Starovoitov
[off-list ref] wrote:
From: Alexei Starovoitov <ast@kernel.org>

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.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
---
Seems correct. And nice that maps don't have to care about this anymore.

Acked-by: Andrii Nakryiko <redacted>
 kernel/bpf/arraymap.c         | 9 ---------
 kernel/bpf/hashtab.c          | 8 +++-----
 kernel/bpf/lpm_trie.c         | 5 -----
 kernel/bpf/queue_stack_maps.c | 7 -------
 kernel/bpf/reuseport_array.c  | 2 --
 kernel/bpf/ringbuf.c          | 7 -------
 kernel/bpf/stackmap.c         | 3 ---
 7 files changed, 3 insertions(+), 38 deletions(-)
Thread (16 messages) 16 messages, 2 authors, last reply 2020-06-30
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help