[Devel] [PATCH hci-8.1] ms/mm/shrinker: allocate shrinker_info_unit from a dedicated kmem_cache
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Tue Oct 20 18:15:47 MSK 2026
> shrinker_info_unit holds BITS_PER_LONG atomic_long_t of deferred work plus
> a one-word bitmap, 520 bytes on 64-bit. kzalloc_node() takes it from
> kmalloc-1k, so almost half of every unit is padding.
>
> Allocate the units from a cache of their own, sized to the unit. The
> cache is not cache-line aligned: the counters of a unit already share
> cache lines between shrinkers, and aligning the unit would only keep
> neighbouring units off each other's boundary line, at the cost of part of
> the saving.
>
> Link: https://lore.kernel.org/20261019-vstor-144715-shrinker_info_unit-kmem_cache-v3-1-0fb061e09bf4@virtuozzo.com
> Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
> Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
> Suggested-by: Andrew Morton <akpm at linux-foundation.org>
> Reviewed-by: Harry Yoo (Meta) <harry at kernel.org>
> [ ... ]
> https://virtuozzo.atlassian.net/browse/VSTOR-144714
>
> Feature: mm/shrinker: sparse per-memcg shrinker units
> Assisted-by: LLM
> Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261020-b4-prep-khorenko-vstor-144714-shrinkers-kmem_cache-v1-1-4bdb03031132@virtuozzo.com?part=1
More information about the Devel
mailing list