mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] mm/zsmalloc: remove CONFIG_ZSMALLOC_STAT
@ 2026-11-09 12:59 Xueyuan Chen
  2026-11-09 12:59 ` [PATCH v2 1/3] " Xueyuan Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Xueyuan Chen @ 2026-11-09 12:59 UTC (permalink / raw)
  To: Minchan Kim, Sergey Senozhatsky, Nhat Pham
  Cc: Andrew Morton, linux-mm, linux-kernel, Xueyuan Chen

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 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@gmail.com

---
Xueyuan Chen (3):
      mm/zsmalloc: remove CONFIG_ZSMALLOC_STAT
      mm: remove CONFIG_ZSMALLOC_STAT
      docs: zsmalloc: describe statistics with CONFIG_DEBUG_FS

 Documentation/mm/zsmalloc.rst                    |  2 +-
 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, 9 insertions(+), 47 deletions(-)
---
base-commit: fa4ad798f6f681031775266044ba1b0cf3c670bd

--  
Best regards,
Xueyuan


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 1/3] mm/zsmalloc: remove CONFIG_ZSMALLOC_STAT
  2026-11-09 12:59 [PATCH v2 0/3] mm/zsmalloc: remove CONFIG_ZSMALLOC_STAT Xueyuan Chen
@ 2026-11-09 12:59 ` Xueyuan Chen
  2026-11-10 15:00   ` Nhat Pham
  2026-11-09 12:59 ` [PATCH v2 2/3] mm: " Xueyuan Chen
  2026-11-09 12:59 ` [PATCH v2 3/3] docs: zsmalloc: describe statistics with CONFIG_DEBUG_FS Xueyuan Chen
  2 siblings, 1 reply; 11+ messages in thread
From: Xueyuan Chen @ 2026-11-09 12:59 UTC (permalink / raw)
  To: Minchan Kim, Sergey Senozhatsky, Nhat Pham
  Cc: Andrew Morton, linux-mm, linux-kernel, Xueyuan Chen

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@gmail.com>
Signed-off-by: Xueyuan Chen <xueyuan.chen21@gmail.com>
---
 mm/zsmalloc.c | 33 ++-------------------------------
 1 file changed, 2 insertions(+), 31 deletions(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 7ef80e0da626..104ccf3aa170 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -222,9 +222,7 @@ struct zs_size_stat {
 	unsigned long objs[NR_CLASS_STAT_TYPES];
 };
 
-#ifdef CONFIG_ZSMALLOC_STAT
 static struct dentry *zs_stat_root;
-#endif
 
 static size_t huge_class_size;
 
@@ -279,9 +277,7 @@ struct zs_pool {
 	/* Compact classes */
 	struct shrinker *shrinker;
 
-#ifdef CONFIG_ZSMALLOC_STAT
 	struct dentry *stat_dentry;
-#endif
 #ifdef CONFIG_COMPACTION
 	struct work_struct free_work;
 #endif
@@ -565,14 +561,10 @@ static inline unsigned long class_stat_read(struct size_class *class, int type)
 	return class->stats.objs[type];
 }
 
-#ifdef CONFIG_ZSMALLOC_STAT
-
 static void __init zs_stat_init(void)
 {
-	if (!debugfs_initialized()) {
-		pr_warn("debugfs not available, stat dir not created\n");
+	if (!debugfs_initialized())
 		return;
-	}
 
 	zs_stat_root = debugfs_create_dir("zsmalloc", NULL);
 }
@@ -650,10 +642,8 @@ DEFINE_SHOW_ATTRIBUTE(zs_stats_size);
 
 static void zs_pool_stat_create(struct zs_pool *pool, const char *name)
 {
-	if (!zs_stat_root) {
-		pr_warn("no root stat dir, not creating <%s> stat dir\n", name);
+	if (IS_ERR_OR_NULL(zs_stat_root))
 		return;
-	}
 
 	pool->stat_dentry = debugfs_create_dir(name, zs_stat_root);
 
@@ -666,25 +656,6 @@ static void zs_pool_stat_destroy(struct zs_pool *pool)
 	debugfs_remove_recursive(pool->stat_dentry);
 }
 
-#else /* CONFIG_ZSMALLOC_STAT */
-static void __init zs_stat_init(void)
-{
-}
-
-static void __exit zs_stat_exit(void)
-{
-}
-
-static inline void zs_pool_stat_create(struct zs_pool *pool, const char *name)
-{
-}
-
-static inline void zs_pool_stat_destroy(struct zs_pool *pool)
-{
-}
-#endif
-
-
 /*
  * For each size class, zspages are divided into different groups
  * depending on their usage ratio. This function returns fullness

-- 
2.47.3


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 2/3] mm: remove CONFIG_ZSMALLOC_STAT
  2026-11-09 12:59 [PATCH v2 0/3] mm/zsmalloc: remove CONFIG_ZSMALLOC_STAT Xueyuan Chen
  2026-11-09 12:59 ` [PATCH v2 1/3] " Xueyuan Chen
@ 2026-11-09 12:59 ` Xueyuan Chen
  2026-11-10 15:03   ` Nhat Pham
  2026-11-11  4:33   ` Sergey Senozhatsky
  2026-11-09 12:59 ` [PATCH v2 3/3] docs: zsmalloc: describe statistics with CONFIG_DEBUG_FS Xueyuan Chen
  2 siblings, 2 replies; 11+ messages in thread
From: Xueyuan Chen @ 2026-11-09 12:59 UTC (permalink / raw)
  To: Minchan Kim, Sergey Senozhatsky, Nhat Pham
  Cc: Andrew Morton, linux-mm, linux-kernel, Xueyuan Chen

The statistics interface now uses the debugfs API stubs directly, so
CONFIG_ZSMALLOC_STAT no longer controls any zsmalloc code.

Remove the Kconfig entry. Replace the remaining CONFIG_ZSMALLOC_STAT
settings with CONFIG_DEBUG_FS=y.

Suggested-by: Nhat Pham <nphamcs@gmail.com>
Signed-off-by: Xueyuan Chen <xueyuan.chen21@gmail.com>
---
 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 ---------
 6 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/arch/s390/configs/debug_defconfig b/arch/s390/configs/debug_defconfig
index d44674b63715..83193ef8efb9 100644
--- a/arch/s390/configs/debug_defconfig
+++ b/arch/s390/configs/debug_defconfig
@@ -100,7 +100,7 @@ CONFIG_UNIXWARE_DISKLABEL=y
 CONFIG_IOSCHED_BFQ=y
 CONFIG_BINFMT_MISC=m
 CONFIG_ZSWAP=y
-CONFIG_ZSMALLOC_STAT=y
+CONFIG_DEBUG_FS=y
 CONFIG_SLAB_BUCKETS=y
 CONFIG_SLUB_STATS=y
 # CONFIG_COMPAT_BRK is not set
diff --git a/arch/s390/configs/defconfig b/arch/s390/configs/defconfig
index e00e252d4694..694a309377d5 100644
--- a/arch/s390/configs/defconfig
+++ b/arch/s390/configs/defconfig
@@ -94,7 +94,7 @@ CONFIG_UNIXWARE_DISKLABEL=y
 CONFIG_IOSCHED_BFQ=y
 CONFIG_BINFMT_MISC=m
 CONFIG_ZSWAP=y
-CONFIG_ZSMALLOC_STAT=y
+CONFIG_DEBUG_FS=y
 CONFIG_SLAB_BUCKETS=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_MEMORY_HOTPLUG=y
diff --git a/drivers/gpu/drm/ci/arm.config b/drivers/gpu/drm/ci/arm.config
index d7c51670da2f..fc0a8a4bfb18 100644
--- a/drivers/gpu/drm/ci/arm.config
+++ b/drivers/gpu/drm/ci/arm.config
@@ -5,7 +5,7 @@ CONFIG_CRYPTO_ZSTD=y
 CONFIG_ZRAM_MEMORY_TRACKING=y
 CONFIG_ZRAM_WRITEBACK=y
 CONFIG_ZRAM=y
-CONFIG_ZSMALLOC_STAT=y
+CONFIG_DEBUG_FS=y
 
 # abootimg with a 'dummy' rootfs fails with root=/dev/nfs
 CONFIG_BLK_DEV_INITRD=n
diff --git a/drivers/gpu/drm/ci/arm64.config b/drivers/gpu/drm/ci/arm64.config
index c46125c1f80f..10b01b55a66d 100644
--- a/drivers/gpu/drm/ci/arm64.config
+++ b/drivers/gpu/drm/ci/arm64.config
@@ -5,7 +5,7 @@ CONFIG_CRYPTO_ZSTD=y
 CONFIG_ZRAM_MEMORY_TRACKING=y
 CONFIG_ZRAM_WRITEBACK=y
 CONFIG_ZRAM=y
-CONFIG_ZSMALLOC_STAT=y
+CONFIG_DEBUG_FS=y
 
 # abootimg with a 'dummy' rootfs fails with root=/dev/nfs
 CONFIG_BLK_DEV_INITRD=n
diff --git a/drivers/gpu/drm/ci/x86_64.config b/drivers/gpu/drm/ci/x86_64.config
index 7ac98a78691e..8225b806dad8 100644
--- a/drivers/gpu/drm/ci/x86_64.config
+++ b/drivers/gpu/drm/ci/x86_64.config
@@ -5,7 +5,7 @@ CONFIG_CRYPTO_ZSTD=y
 CONFIG_ZRAM_MEMORY_TRACKING=y
 CONFIG_ZRAM_WRITEBACK=y
 CONFIG_ZRAM=y
-CONFIG_ZSMALLOC_STAT=y
+CONFIG_DEBUG_FS=y
 
 CONFIG_PWM=y
 CONFIG_PM_DEVFREQ=y
diff --git a/mm/Kconfig b/mm/Kconfig
index afff1b25b543..4a77cda7f1d7 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -130,15 +130,6 @@ menu "Zsmalloc allocator options"
 
 comment "Zsmalloc is a common backend allocator for zswap & zram"
 
-config ZSMALLOC_STAT
-	bool "Export zsmalloc statistics"
-	select DEBUG_FS
-	help
-	  This option enables code in the zsmalloc to collect various
-	  statistics about what's happening in zsmalloc and exports that
-	  information to userspace via debugfs.
-	  If unsure, say N.
-
 config ZSMALLOC_CHAIN_SIZE
 	int "Maximum number of physical pages per-zspage"
 	default 8

-- 
2.47.3


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 3/3] docs: zsmalloc: describe statistics with CONFIG_DEBUG_FS
  2026-11-09 12:59 [PATCH v2 0/3] mm/zsmalloc: remove CONFIG_ZSMALLOC_STAT Xueyuan Chen
  2026-11-09 12:59 ` [PATCH v2 1/3] " Xueyuan Chen
  2026-11-09 12:59 ` [PATCH v2 2/3] mm: " Xueyuan Chen
@ 2026-11-09 12:59 ` Xueyuan Chen
  2026-11-10 15:03   ` Nhat Pham
  2 siblings, 1 reply; 11+ messages in thread
From: Xueyuan Chen @ 2026-11-09 12:59 UTC (permalink / raw)
  To: Minchan Kim, Sergey Senozhatsky, Nhat Pham
  Cc: Andrew Morton, linux-mm, linux-kernel, Xueyuan Chen

Zsmalloc statistics are now available when debugfs is enabled. Replace
references to CONFIG_ZSMALLOC_STAT with CONFIG_DEBUG_FS in the English
and Chinese documentation.

Suggested-by: Nhat Pham <nphamcs@gmail.com>
Signed-off-by: Xueyuan Chen <xueyuan.chen21@gmail.com>
---
 Documentation/mm/zsmalloc.rst                    | 2 +-
 Documentation/translations/zh_CN/mm/zsmalloc.rst | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/mm/zsmalloc.rst b/Documentation/mm/zsmalloc.rst
index d2bbecd78e14..8c61733c6749 100644
--- a/Documentation/mm/zsmalloc.rst
+++ b/Documentation/mm/zsmalloc.rst
@@ -33,7 +33,7 @@ proper handle-based APIs.
 stat
 ====
 
-With CONFIG_ZSMALLOC_STAT, we could see zsmalloc internal information via
+With CONFIG_DEBUG_FS, we could see zsmalloc internal information via
 ``/sys/kernel/debug/zsmalloc/<user name>``. Here is a sample of stat output::
 
  # cat /sys/kernel/debug/zsmalloc/zram0/classes
diff --git a/Documentation/translations/zh_CN/mm/zsmalloc.rst b/Documentation/translations/zh_CN/mm/zsmalloc.rst
index 4c8c9b1006a9..d163f4aab341 100644
--- a/Documentation/translations/zh_CN/mm/zsmalloc.rst
+++ b/Documentation/translations/zh_CN/mm/zsmalloc.rst
@@ -32,7 +32,7 @@ zs_unmap_object()解除映射。
 stat
 ====
 
-通过CONFIG_ZSMALLOC_STAT,我们可以通过 ``/sys/kernel/debug/zsmalloc/<user name>``
+通过CONFIG_DEBUG_FS,我们可以通过 ``/sys/kernel/debug/zsmalloc/<user name>``
 看到zsmalloc内部信息。下面是一个统计输出的例子。::
 
  # cat /sys/kernel/debug/zsmalloc/zram0/classes

-- 
2.47.3


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 1/3] mm/zsmalloc: remove CONFIG_ZSMALLOC_STAT
  2026-11-09 12:59 ` [PATCH v2 1/3] " Xueyuan Chen
@ 2026-11-10 15:00   ` Nhat Pham
  2026-11-11  4:35     ` Sergey Senozhatsky
  0 siblings, 1 reply; 11+ messages in thread
From: Nhat Pham @ 2026-11-10 15:00 UTC (permalink / raw)
  To: Xueyuan Chen
  Cc: Minchan Kim, Sergey Senozhatsky, Andrew Morton, linux-mm, linux-kernel

On Mon, Nov 9, 2026 at 5:59 AM Xueyuan Chen <xueyuan.chen21@gmail.com> 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@gmail.com>
> Signed-off-by: Xueyuan Chen <xueyuan.chen21@gmail.com>
> ---
>  mm/zsmalloc.c | 33 ++-------------------------------
>  1 file changed, 2 insertions(+), 31 deletions(-)

FWIW, LGTM:

Reviewed-by: Nhat Pham <nphamcs@gmail.com>

But I come from the perspective of large(r) server machines - I'd wait
for the feedback of embedded folks too :)

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?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/3] mm: remove CONFIG_ZSMALLOC_STAT
  2026-11-09 12:59 ` [PATCH v2 2/3] mm: " Xueyuan Chen
@ 2026-11-10 15:03   ` Nhat Pham
  2026-11-11  4:38     ` Sergey Senozhatsky
  2026-11-11  4:33   ` Sergey Senozhatsky
  1 sibling, 1 reply; 11+ messages in thread
From: Nhat Pham @ 2026-11-10 15:03 UTC (permalink / raw)
  To: Xueyuan Chen
  Cc: Minchan Kim, Sergey Senozhatsky, Andrew Morton, linux-mm, linux-kernel

On Mon, Nov 9, 2026 at 5:59 AM Xueyuan Chen <xueyuan.chen21@gmail.com> wrote:
>
> The statistics interface now uses the debugfs API stubs directly, so
> CONFIG_ZSMALLOC_STAT no longer controls any zsmalloc code.
>
> Remove the Kconfig entry. Replace the remaining CONFIG_ZSMALLOC_STAT
> settings with CONFIG_DEBUG_FS=y.
>
> Suggested-by: Nhat Pham <nphamcs@gmail.com>
> Signed-off-by: Xueyuan Chen <xueyuan.chen21@gmail.com>

I wonder if we can just squash all 3 patches lol. Anyway, LGTM:

Reviewed-by: Nhat Pham <nphamcs@gmail.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 3/3] docs: zsmalloc: describe statistics with CONFIG_DEBUG_FS
  2026-11-09 12:59 ` [PATCH v2 3/3] docs: zsmalloc: describe statistics with CONFIG_DEBUG_FS Xueyuan Chen
@ 2026-11-10 15:03   ` Nhat Pham
  0 siblings, 0 replies; 11+ messages in thread
From: Nhat Pham @ 2026-11-10 15:03 UTC (permalink / raw)
  To: Xueyuan Chen
  Cc: Minchan Kim, Sergey Senozhatsky, Andrew Morton, linux-mm, linux-kernel

On Mon, Nov 9, 2026 at 5:59 AM Xueyuan Chen <xueyuan.chen21@gmail.com> wrote:
>
> Zsmalloc statistics are now available when debugfs is enabled. Replace
> references to CONFIG_ZSMALLOC_STAT with CONFIG_DEBUG_FS in the English
> and Chinese documentation.
>
> Suggested-by: Nhat Pham <nphamcs@gmail.com>
> Signed-off-by: Xueyuan Chen <xueyuan.chen21@gmail.com>

For the English documentation:

Reviewed-by: Nhat Pham <nphamcs@gmail.com>

(but I'm mildly certain the Chinese one is also correct :))

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/3] mm: remove CONFIG_ZSMALLOC_STAT
  2026-11-09 12:59 ` [PATCH v2 2/3] mm: " Xueyuan Chen
  2026-11-10 15:03   ` Nhat Pham
@ 2026-11-11  4:33   ` Sergey Senozhatsky
  2026-11-11  4:37     ` Sergey Senozhatsky
  1 sibling, 1 reply; 11+ messages in thread
From: Sergey Senozhatsky @ 2026-11-11  4:33 UTC (permalink / raw)
  To: Xueyuan Chen
  Cc: Minchan Kim, Sergey Senozhatsky, Nhat Pham, Andrew Morton,
	linux-mm, linux-kernel

On (26/11/09 20:59), Xueyuan Chen wrote:
[..]
>  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 ---------
>  6 files changed, 5 insertions(+), 14 deletions(-)
> 
> diff --git a/arch/s390/configs/debug_defconfig b/arch/s390/configs/debug_defconfig
> index d44674b63715..83193ef8efb9 100644
> --- a/arch/s390/configs/debug_defconfig
> +++ b/arch/s390/configs/debug_defconfig
> @@ -100,7 +100,7 @@ CONFIG_UNIXWARE_DISKLABEL=y
>  CONFIG_IOSCHED_BFQ=y
>  CONFIG_BINFMT_MISC=m
>  CONFIG_ZSWAP=y
> -CONFIG_ZSMALLOC_STAT=y
> +CONFIG_DEBUG_FS=y
>  CONFIG_SLAB_BUCKETS=y
>  CONFIG_SLUB_STATS=y
>  # CONFIG_COMPAT_BRK is not set
> diff --git a/arch/s390/configs/defconfig b/arch/s390/configs/defconfig
> index e00e252d4694..694a309377d5 100644
> --- a/arch/s390/configs/defconfig
> +++ b/arch/s390/configs/defconfig
> @@ -94,7 +94,7 @@ CONFIG_UNIXWARE_DISKLABEL=y
>  CONFIG_IOSCHED_BFQ=y
>  CONFIG_BINFMT_MISC=m
>  CONFIG_ZSWAP=y
> -CONFIG_ZSMALLOC_STAT=y
> +CONFIG_DEBUG_FS=y
>  CONFIG_SLAB_BUCKETS=y
>  # CONFIG_COMPAT_BRK is not set
>  CONFIG_MEMORY_HOTPLUG=y
> diff --git a/drivers/gpu/drm/ci/arm.config b/drivers/gpu/drm/ci/arm.config
> index d7c51670da2f..fc0a8a4bfb18 100644
> --- a/drivers/gpu/drm/ci/arm.config
> +++ b/drivers/gpu/drm/ci/arm.config
> @@ -5,7 +5,7 @@ CONFIG_CRYPTO_ZSTD=y
>  CONFIG_ZRAM_MEMORY_TRACKING=y
>  CONFIG_ZRAM_WRITEBACK=y
>  CONFIG_ZRAM=y
> -CONFIG_ZSMALLOC_STAT=y
> +CONFIG_DEBUG_FS=y
>  
>  # abootimg with a 'dummy' rootfs fails with root=/dev/nfs
>  CONFIG_BLK_DEV_INITRD=n
> diff --git a/drivers/gpu/drm/ci/arm64.config b/drivers/gpu/drm/ci/arm64.config
> index c46125c1f80f..10b01b55a66d 100644
> --- a/drivers/gpu/drm/ci/arm64.config
> +++ b/drivers/gpu/drm/ci/arm64.config
> @@ -5,7 +5,7 @@ CONFIG_CRYPTO_ZSTD=y
>  CONFIG_ZRAM_MEMORY_TRACKING=y
>  CONFIG_ZRAM_WRITEBACK=y
>  CONFIG_ZRAM=y
> -CONFIG_ZSMALLOC_STAT=y
> +CONFIG_DEBUG_FS=y
>  
>  # abootimg with a 'dummy' rootfs fails with root=/dev/nfs
>  CONFIG_BLK_DEV_INITRD=n
> diff --git a/drivers/gpu/drm/ci/x86_64.config b/drivers/gpu/drm/ci/x86_64.config
> index 7ac98a78691e..8225b806dad8 100644
> --- a/drivers/gpu/drm/ci/x86_64.config
> +++ b/drivers/gpu/drm/ci/x86_64.config
> @@ -5,7 +5,7 @@ CONFIG_CRYPTO_ZSTD=y
>  CONFIG_ZRAM_MEMORY_TRACKING=y
>  CONFIG_ZRAM_WRITEBACK=y
>  CONFIG_ZRAM=y
> -CONFIG_ZSMALLOC_STAT=y
> +CONFIG_DEBUG_FS=y

Really not sure what those are.  I'd rather prefer not to touch
any configs at all.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 1/3] mm/zsmalloc: remove CONFIG_ZSMALLOC_STAT
  2026-11-10 15:00   ` Nhat Pham
@ 2026-11-11  4:35     ` Sergey Senozhatsky
  0 siblings, 0 replies; 11+ messages in thread
From: Sergey Senozhatsky @ 2026-11-11  4:35 UTC (permalink / raw)
  To: Nhat Pham
  Cc: Xueyuan Chen, Minchan Kim, Sergey Senozhatsky, Andrew Morton,
	linux-mm, linux-kernel

On (26/11/10 08:00), Nhat Pham wrote:
> On Mon, Nov 9, 2026 at 5:59 AM Xueyuan Chen <xueyuan.chen21@gmail.com> 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@gmail.com>
> > Signed-off-by: Xueyuan Chen <xueyuan.chen21@gmail.com>
> > ---
> >  mm/zsmalloc.c | 33 ++-------------------------------
> >  1 file changed, 2 insertions(+), 31 deletions(-)
> 
> FWIW, LGTM:
> 
> Reviewed-by: Nhat Pham <nphamcs@gmail.com>
> 
> But I come from the perspective of large(r) server machines - I'd wait
> for the feedback of embedded folks too :)
> 
> 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?

Yeah I guess I'm fine with this change.
I think this can be just one patch.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/3] mm: remove CONFIG_ZSMALLOC_STAT
  2026-11-11  4:33   ` Sergey Senozhatsky
@ 2026-11-11  4:37     ` Sergey Senozhatsky
  0 siblings, 0 replies; 11+ messages in thread
From: Sergey Senozhatsky @ 2026-11-11  4:37 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Xueyuan Chen, Minchan Kim, Nhat Pham, Andrew Morton, linux-mm,
	linux-kernel

On (26/11/11 13:33), Sergey Senozhatsky wrote:
[..]
> > diff --git a/arch/s390/configs/debug_defconfig b/arch/s390/configs/debug_defconfig
> > index d44674b63715..83193ef8efb9 100644
> > --- a/arch/s390/configs/debug_defconfig
> > +++ b/arch/s390/configs/debug_defconfig
> > @@ -100,7 +100,7 @@ CONFIG_UNIXWARE_DISKLABEL=y
> >  CONFIG_IOSCHED_BFQ=y
> >  CONFIG_BINFMT_MISC=m
> >  CONFIG_ZSWAP=y
> > -CONFIG_ZSMALLOC_STAT=y
> > +CONFIG_DEBUG_FS=y
> >  CONFIG_SLAB_BUCKETS=y
> >  CONFIG_SLUB_STATS=y
> >  # CONFIG_COMPAT_BRK is not set
> > diff --git a/arch/s390/configs/defconfig b/arch/s390/configs/defconfig
> > index e00e252d4694..694a309377d5 100644
> > --- a/arch/s390/configs/defconfig
> > +++ b/arch/s390/configs/defconfig
> > @@ -94,7 +94,7 @@ CONFIG_UNIXWARE_DISKLABEL=y
> >  CONFIG_IOSCHED_BFQ=y
> >  CONFIG_BINFMT_MISC=m
> >  CONFIG_ZSWAP=y
> > -CONFIG_ZSMALLOC_STAT=y
> > +CONFIG_DEBUG_FS=y
> >  CONFIG_SLAB_BUCKETS=y
> >  # CONFIG_COMPAT_BRK is not set
> >  CONFIG_MEMORY_HOTPLUG=y
> > diff --git a/drivers/gpu/drm/ci/arm.config b/drivers/gpu/drm/ci/arm.config
> > index d7c51670da2f..fc0a8a4bfb18 100644
> > --- a/drivers/gpu/drm/ci/arm.config
> > +++ b/drivers/gpu/drm/ci/arm.config
> > @@ -5,7 +5,7 @@ CONFIG_CRYPTO_ZSTD=y
> >  CONFIG_ZRAM_MEMORY_TRACKING=y
> >  CONFIG_ZRAM_WRITEBACK=y
> >  CONFIG_ZRAM=y
> > -CONFIG_ZSMALLOC_STAT=y
> > +CONFIG_DEBUG_FS=y
> >  
> >  # abootimg with a 'dummy' rootfs fails with root=/dev/nfs
> >  CONFIG_BLK_DEV_INITRD=n
> > diff --git a/drivers/gpu/drm/ci/arm64.config b/drivers/gpu/drm/ci/arm64.config
> > index c46125c1f80f..10b01b55a66d 100644
> > --- a/drivers/gpu/drm/ci/arm64.config
> > +++ b/drivers/gpu/drm/ci/arm64.config
> > @@ -5,7 +5,7 @@ CONFIG_CRYPTO_ZSTD=y
> >  CONFIG_ZRAM_MEMORY_TRACKING=y
> >  CONFIG_ZRAM_WRITEBACK=y
> >  CONFIG_ZRAM=y
> > -CONFIG_ZSMALLOC_STAT=y
> > +CONFIG_DEBUG_FS=y
> >  
> >  # abootimg with a 'dummy' rootfs fails with root=/dev/nfs
> >  CONFIG_BLK_DEV_INITRD=n
> > diff --git a/drivers/gpu/drm/ci/x86_64.config b/drivers/gpu/drm/ci/x86_64.config
> > index 7ac98a78691e..8225b806dad8 100644
> > --- a/drivers/gpu/drm/ci/x86_64.config
> > +++ b/drivers/gpu/drm/ci/x86_64.config
> > @@ -5,7 +5,7 @@ CONFIG_CRYPTO_ZSTD=y
> >  CONFIG_ZRAM_MEMORY_TRACKING=y
> >  CONFIG_ZRAM_WRITEBACK=y
> >  CONFIG_ZRAM=y
> > -CONFIG_ZSMALLOC_STAT=y
> > +CONFIG_DEBUG_FS=y
> 
> Really not sure what those are.  I'd rather prefer not to touch
> any configs at all.


Never mind, scratch my last comment.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/3] mm: remove CONFIG_ZSMALLOC_STAT
  2026-11-10 15:03   ` Nhat Pham
@ 2026-11-11  4:38     ` Sergey Senozhatsky
  0 siblings, 0 replies; 11+ messages in thread
From: Sergey Senozhatsky @ 2026-11-11  4:38 UTC (permalink / raw)
  To: Nhat Pham
  Cc: Xueyuan Chen, Minchan Kim, Sergey Senozhatsky, Andrew Morton,
	linux-mm, linux-kernel

On (26/11/10 08:03), Nhat Pham wrote:
> On Mon, Nov 9, 2026 at 5:59 AM Xueyuan Chen <xueyuan.chen21@gmail.com> wrote:
> >
> > The statistics interface now uses the debugfs API stubs directly, so
> > CONFIG_ZSMALLOC_STAT no longer controls any zsmalloc code.
> >
> > Remove the Kconfig entry. Replace the remaining CONFIG_ZSMALLOC_STAT
> > settings with CONFIG_DEBUG_FS=y.
> >
> > Suggested-by: Nhat Pham <nphamcs@gmail.com>
> > Signed-off-by: Xueyuan Chen <xueyuan.chen21@gmail.com>
> 
> I wonder if we can just squash all 3 patches lol

I agree.  Let's have just one patch.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-11-11  4:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 12:59 [PATCH v2 0/3] mm/zsmalloc: remove CONFIG_ZSMALLOC_STAT Xueyuan Chen
2026-11-09 12:59 ` [PATCH v2 1/3] " Xueyuan Chen
2026-11-10 15:00   ` Nhat Pham
2026-11-11  4:35     ` Sergey Senozhatsky
2026-11-09 12:59 ` [PATCH v2 2/3] mm: " Xueyuan Chen
2026-11-10 15:03   ` Nhat Pham
2026-11-11  4:38     ` Sergey Senozhatsky
2026-11-11  4:33   ` Sergey Senozhatsky
2026-11-11  4:37     ` Sergey Senozhatsky
2026-11-09 12:59 ` [PATCH v2 3/3] docs: zsmalloc: describe statistics with CONFIG_DEBUG_FS Xueyuan Chen
2026-11-10 15:03   ` Nhat Pham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®