bpf: Prepare bpf_mem_alloc to be used by sleepable bpf programs.
authorAlexei Starovoitov <ast@kernel.org>
Fri, 2 Sep 2022 21:10:55 +0000 (14:10 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 5 Sep 2022 13:33:06 +0000 (15:33 +0200)
commitdccb4a9013a68ddcb8303cd60f2fca1742014f3f
tree9a5493637aa7952ff2999ffb2c03cadeae56c0ff
parent96da3f7d489d11b43e7c1af90d876b9a2492cca8
bpf: Prepare bpf_mem_alloc to be used by sleepable bpf programs.

Use call_rcu_tasks_trace() to wait for sleepable progs to finish.
Then use call_rcu() to wait for normal progs to finish
and finally do free_one() on each element when freeing objects
into global memory pool.

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-14-alexei.starovoitov@gmail.com
kernel/bpf/memalloc.c