Re: [PATCH v2 1/3] mm/zsmalloc: remove CONFIG_ZSMALLOC_STAT
From: Xueyuan Chen
Date: Wed Nov 11 2026 - 06:22:15 EST
On 2026-11-10 08:00 -0700, Nhat Pham wrote:
> On Mon, Nov 9, 2026 at 5:59 AM Xueyuan Chen <xueyuan.chen21@xxxxxxxxx> wrote:
> >
> > CONFIG_ZSMALLOC_STAT only controls the debugfs interface. The class
> > counters are updated regardless of this option.
> >
> > Remove the CONFIG_ZSMALLOC_STAT guards and rely on the debugfs API
> > stubs when CONFIG_DEBUG_FS=n. Skip statistics setup silently when
> > debugfs is unavailable.
> >
> > Suggested-by: Nhat Pham <nphamcs@xxxxxxxxx>
> > Signed-off-by: Xueyuan Chen <xueyuan.chen21@xxxxxxxxx>
> > ---
> > mm/zsmalloc.c | 33 ++-------------------------------
> > 1 file changed, 2 insertions(+), 31 deletions(-)
>
> FWIW, LGTM:
>
> Reviewed-by: Nhat Pham <nphamcs@xxxxxxxxx>
Thanks for the review!
>
> But I come from the perspective of large(r) server machines - I'd wait
> for the feedback of embedded folks too :)
I also tested the memory overhead. For a typical Android setup with
one zram pool, the additional inode/dentry slab object footprint is about 2.11 KB.
Even with 32 pools, it's only about 45.7 KB.
I think this overhead is acceptable for embedded devices.
>
> Sergey, how do you feel about this direction? We've run the stats
> collection (even before we select CONFIG_ZSMALLOC_STAT to expose the
> stats to userspace) for eons, and it was never a bottleneck AFAICS in
> our fleet... And the stats files seem trivial, relatively speaking?
>