Re: [PATCH v3] mm/zsmalloc: remove CONFIG_ZSMALLOC_STAT

From: Xueyuan Chen

Date: Wed Nov 11 2026 - 20:32:35 EST


On 2026-11-11 16:26 -0800, Randy Dunlap wrote:
>
>
> On 11/11/26 4:41 AM, Xueyuan Chen 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.
> >
> > Remove the Kconfig entry and replace the existing CONFIG_ZSMALLOC_STAT
> > settings with CONFIG_DEBUG_FS=y. Update the English and Chinese
> > documentation to match, and clarify the pool name in the debugfs path.
> >
> > Suggested-by: Nhat Pham <nphamcs@xxxxxxxxx>
> > Reviewed-by: Nhat Pham <nphamcs@xxxxxxxxx>
> > Signed-off-by: Xueyuan Chen <xueyuan.chen21@xxxxxxxxx>
>
> Reviewed-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Thanks!
> Thanks.
>
> > ---
> > Drop CONFIG_ZSMALLOC_STAT instead of making the counters conditional. The
> > option only controls the debugfs interface, while the class counters are
> > updated unconditionally. Removing it simplifies the code.
> >
> > Following Nhat's suggestion, remove CONFIG_ZSMALLOC_STAT and rely on
> > the existing debugfs API stubs when CONFIG_DEBUG_FS=n.
> > ---
> > Changes in v3:
> > - Squash the three patches into one (Nhat, Sergey).
> > - Add Nhat's Reviewed-by.
> > - Update the documentation wording.
> > - Link to v2: https://patch.msgid.link/20261109-zsmalloc_stat-v2-0-caee41684aba@xxxxxxxxx
> >
> > Changes in v2:
> > - Drop CONFIG_ZSMALLOC_STAT instead of making the counters conditional.
> > - Update configuration files and documentation.
> > - Link to v1: https://patch.msgid.link/20261106-zsmalloc_stat-v1-1-b574f4714adf@xxxxxxxxx
> > ---
> > Documentation/mm/zsmalloc.rst | 4 +--
> > Documentation/translations/zh_CN/mm/zsmalloc.rst | 2 +-
> > arch/s390/configs/debug_defconfig | 2 +-
> > arch/s390/configs/defconfig | 2 +-
> > drivers/gpu/drm/ci/arm.config | 2 +-
> > drivers/gpu/drm/ci/arm64.config | 2 +-
> > drivers/gpu/drm/ci/x86_64.config | 2 +-
> > mm/Kconfig | 9 -------
> > mm/zsmalloc.c | 33 ++----------------------
> > 9 files changed, 10 insertions(+), 48 deletions(-)
>
>
> --
> ~Randy
>
>