]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Adjust low/high watermarks in bpf_mem_cache
authorAlexei Starovoitov <ast@kernel.org>
Fri, 2 Sep 2022 21:10:50 +0000 (14:10 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 5 Sep 2022 13:33:06 +0000 (15:33 +0200)
commitd69061a7e9fdcf6c012514a83bae5568b550f76c
tree836f9c901619e80222a96108acdd49ce7fe1f26f
parentf6147145af24eab0127b74fbccf1651936a2d814
bpf: Adjust low/high watermarks in bpf_mem_cache

The same low/high watermarks for every bucket in bpf_mem_cache consume
significant amount of memory. Preallocating 64 elements of 4096 bytes each in
the free list is not efficient. Make low/high watermarks and batching value
dependent on element size. This change brings significant memory savings.

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