bpf: Don't prefill for unused bpf_mem_cache
authorHou Tao <houtao1@huawei.com>
Fri, 8 Sep 2023 13:39:21 +0000 (21:39 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 11 Sep 2023 19:41:37 +0000 (12:41 -0700)
commitb1d53958b69312e43c118d4093d8f93d3f6f80af
treeb8128293cd5b81af6bd4391dddbc90396024fc8e
parentd52b59315bf5e86e83c00bfae47cedd388dad6a8
bpf: Don't prefill for unused bpf_mem_cache

When the unit_size of a bpf_mem_cache is unmatched with the object_size
of the underlying slab cache, the bpf_mem_cache will not be used, and
the allocation will be redirected to a bpf_mem_cache with a bigger
unit_size instead, so there is no need to prefill for these
unused bpf_mem_caches.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20230908133923.2675053-3-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/memalloc.c