From: Alexei Starovoitov Date: Mon, 11 Sep 2023 19:41:37 +0000 (-0700) Subject: Merge branch 'fix-the-unmatched-unit_size-of-bpf_mem_cache' X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9458964a6da621873a92f7cf03242c020799ecd3;p=linux.git Merge branch 'fix-the-unmatched-unit_size-of-bpf_mem_cache' Hou Tao says: ==================== Fix the unmatched unit_size of bpf_mem_cache From: Hou Tao Hi, The patchset aims to fix the reported warning [0] when the unit_size of bpf_mem_cache is mismatched with the object size of underly slab-cache. Patch #1 fixes the warning by adjusting size_index according to the value of KMALLOC_MIN_SIZE, so bpf_mem_cache with unit_size which is smaller than KMALLOC_MIN_SIZE or is not aligned with KMALLOC_MIN_SIZE will be redirected to bpf_mem_cache with bigger unit_size. Patch #2 doesn't do prefill for these redirected bpf_mem_cache to save memory. Patch #3 adds further error check in bpf_mem_alloc_init() to ensure the unit_size and object_size are always matched and to prevent potential issues due to the mismatch. Please see individual patches for more details. And comments are always welcome. [0]: https://lore.kernel.org/bpf/87jztjmmy4.fsf@all.your.base.are.belong.to.us ==================== Link: https://lore.kernel.org/r/20230908133923.2675053-1-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov --- 9458964a6da621873a92f7cf03242c020799ecd3