bpf: Eliminate rlimit-based memory accounting for bpf ringbuffer
authorRoman Gushchin <guro@fb.com>
Tue, 1 Dec 2020 21:58:53 +0000 (13:58 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 3 Dec 2020 02:32:47 +0000 (18:32 -0800)
commitabbdd0813f347f9d1eea376409a68295318b2ef5
tree3194198276361593cb99960ab8c23939d919907d
parentdb54330d3e137c23bea26784cecf5ae17e72e4c6
bpf: Eliminate rlimit-based memory accounting for bpf ringbuffer

Do not use rlimit-based memory accounting for bpf ringbuffer.
It has been replaced with the memcg-based memory accounting.

bpf_ringbuf_alloc() can't return anything except ERR_PTR(-ENOMEM)
and a valid pointer, so to simplify the code make it return NULL
in the first case. This allows to drop a couple of lines in
ringbuf_map_alloc() and also makes it look similar to other memory
allocating function like kmalloc().

Signed-off-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20201201215900.3569844-28-guro@fb.com
kernel/bpf/ringbuf.c