]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
zsmalloc: make common caches global
authorSergey Senozhatsky <senozhatsky@chromium.org>
Sat, 17 Jan 2026 02:54:05 +0000 (11:54 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 6 Feb 2026 23:47:17 +0000 (15:47 -0800)
commit3881b00a2cead778d070f72aa534f0ed589fb4c3
tree7f2039ed86c066ff16f80e2c99693347ee342494
parentef24e0aa078fa4965c6e925209780a32b325c0d8
zsmalloc: make common caches global

Currently, zsmalloc creates kmem_cache of handles and zspages for each
pool, which may be suboptimal from the memory usage point of view (extra
internal fragmentation per pool).  Systems that create multiple zsmalloc
pools may benefit from shared common zsmalloc caches.

Make handles and zspages kmem caches global.  The memory savings depend on
particular setup and data patterns and can be found via slabinfo.

Link: https://lkml.kernel.org/r/20260117025406.799428-1-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: Nhat Pham <nphamcs@gmail.com>
Reviewed-by: Yosry Ahmed <yosry.ahmed@linux.dev>
Cc: Brian Geffon <bgeffon@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/zsmalloc.c