summaryrefslogtreecommitdiff
path: root/kernel/module
diff options
context:
space:
mode:
authorzhouwenhao <zhouwenhao7600@gmail.com>2026-02-02 21:28:46 +0800
committerAndrew Morton <akpm@linux-foundation.org>2026-02-12 15:45:57 -0800
commit5ed4b6b37c647d168ae31035b3f61b705997e043 (patch)
tree52b598a4c4cd13a89e750f26ddeeec03f8478597 /kernel/module
parentb24335521de92fd2ee22460072b75367ca8860b0 (diff)
objpool: fix the overestimation of object pooling metadata size
objpool uses struct objpool_head to store metadata information, and its cpu_slots member points to an array of pointers that store the addresses of the percpu ring arrays. However, the memory size allocated during the initialization of cpu_slots is nr_cpu_ids * sizeof(struct objpool_slot). On a 64-bit machine, the size of struct objpool_slot is 16 bytes, which is twice the size of the actual pointer required, and the extra memory is never be used, resulting in a waste of memory. Therefore, the memory size required for cpu_slots needs to be corrected. Link: https://lkml.kernel.org/r/20260202132846.68257-1-zhouwenhao7600@gmail.com Fixes: b4edb8d2d464 ("lib: objpool added: ring-array based lockless MPMC") Signed-off-by: zhouwenhao <zhouwenhao7600@gmail.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: "Masami Hiramatsu (Google)" <mhiramat@kernel.org> Cc: Matt Wu <wuqiang.matt@bytedance.com> Cc: wuqiang.matt <wuqiang.matt@bytedance.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'kernel/module')
0 files changed, 0 insertions, 0 deletions