]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitd1e3d48e456524c7416cb705ef736b1f1273af70
tree3194198276361593cb99960ab8c23939d919907d
parent97fe246031bd4565901e424c63a43f154db02267
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