Re: [PATCH 03/11] mm/zsmalloc: Introduce conditional memcg awareness to zs_pool
From: Nhat Pham
Date: Wed Mar 11 2026 - 16:13:00 EST
On Wed, Mar 11, 2026 at 12:51 PM Joshua Hahn <joshua.hahnjy@xxxxxxxxx> wrote:
>
> Introduce 3 new fields to struct zs_pool to allow individual zpools to
> be "memcg-aware": memcg_aware, compressed_stat, and uncompressed_stat.
>
> memcg_aware is used in later patches to determine whether memory
> should be allocated to keep track of per-compresed object objgs.
> compressed_stat and uncompressed_stat are enum indices that point into
> memcg (node) stats that zsmalloc will account towards.
>
> In reality, these fields help distinguish between the two users of
> zsmalloc, zswap and zram. The enum indices compressed_stat and
> uncompressed_stat are parametrized to minimize zswap-specific hardcoding
> in zsmalloc.
>
> Suggested-by: Yosry Ahmed <yosry@xxxxxxxxxx>
> Signed-off-by: Joshua Hahn <joshua.hahnjy@xxxxxxxxx>
Zswap side LGTM :) And for that:
Acked-by: Nhat Pham <nphamcs@xxxxxxxxx>