* [PATCH] slab: remove unused SL_CPU slab_stat_type
@ 2026-07-01 14:06 Seongjun Hong
2026-07-02 4:31 ` Harry Yoo
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Seongjun Hong @ 2026-07-01 14:06 UTC (permalink / raw)
To: Vlastimil Babka, Harry Yoo, Andrew Morton
Cc: Seongjun Hong, Hao Li, Christoph Lameter, David Rientjes,
Roman Gushchin, linux-mm, linux-kernel
Since the removal of the per-cpu slab in commit 32c894c7274b ("slab:
remove struct kmem_cache_cpu"), show_slab_objects() no longer has a
branch handling SO_CPU, so cpu_slabs_show() always produces "0".
Emit "0\n" directly instead, matching the sibling cpu_partial and
slabs_cpu_partial stubs, and remove the now-unused SO_CPU macro and
SL_CPU enum value.
No functional change intended; the cpu_slabs sysfs attribute continues
to read 0.
Signed-off-by: Seongjun Hong <hsj0512@snu.ac.kr>
---
mm/slub.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index 9ec774dc7009..f2eb60ce0d23 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -8992,14 +8992,12 @@ static void process_slab(struct loc_track *t, struct kmem_cache *s,
enum slab_stat_type {
SL_ALL, /* All slabs */
SL_PARTIAL, /* Only partially allocated slabs */
- SL_CPU, /* Only slabs used for cpu caches */
SL_OBJECTS, /* Determine allocated objects not slabs */
SL_TOTAL /* Determine object capacity not slabs */
};
#define SO_ALL (1 << SL_ALL)
#define SO_PARTIAL (1 << SL_PARTIAL)
-#define SO_CPU (1 << SL_CPU)
#define SO_OBJECTS (1 << SL_OBJECTS)
#define SO_TOTAL (1 << SL_TOTAL)
@@ -9188,7 +9186,7 @@ SLAB_ATTR_RO(partial);
static ssize_t cpu_slabs_show(struct kmem_cache *s, char *buf)
{
- return show_slab_objects(s, buf, SO_CPU);
+ return sysfs_emit(buf, "0\n");
}
SLAB_ATTR_RO(cpu_slabs);
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] slab: remove unused SL_CPU slab_stat_type
2026-07-01 14:06 [PATCH] slab: remove unused SL_CPU slab_stat_type Seongjun Hong
@ 2026-07-02 4:31 ` Harry Yoo
2026-07-02 6:24 ` Hao Li
2026-07-02 8:15 ` Vlastimil Babka (SUSE)
2 siblings, 0 replies; 4+ messages in thread
From: Harry Yoo @ 2026-07-02 4:31 UTC (permalink / raw)
To: Seongjun Hong, Vlastimil Babka, Andrew Morton
Cc: Hao Li, Christoph Lameter, David Rientjes, Roman Gushchin,
linux-mm, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 667 bytes --]
On 7/1/26 11:06 PM, Seongjun Hong wrote:
> Since the removal of the per-cpu slab in commit 32c894c7274b ("slab:
> remove struct kmem_cache_cpu"), show_slab_objects() no longer has a
> branch handling SO_CPU, so cpu_slabs_show() always produces "0".
>
> Emit "0\n" directly instead, matching the sibling cpu_partial and
> slabs_cpu_partial stubs, and remove the now-unused SO_CPU macro and
> SL_CPU enum value.
>
> No functional change intended; the cpu_slabs sysfs attribute continues
> to read 0.
>
> Signed-off-by: Seongjun Hong <hsj0512@snu.ac.kr>
> ---
Reviewed-by: Harry Yoo (Oracle) <harry@kernel.org>
--
Cheers,
Harry / Hyeonggon
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] slab: remove unused SL_CPU slab_stat_type
2026-07-01 14:06 [PATCH] slab: remove unused SL_CPU slab_stat_type Seongjun Hong
2026-07-02 4:31 ` Harry Yoo
@ 2026-07-02 6:24 ` Hao Li
2026-07-02 8:15 ` Vlastimil Babka (SUSE)
2 siblings, 0 replies; 4+ messages in thread
From: Hao Li @ 2026-07-02 6:24 UTC (permalink / raw)
To: Seongjun Hong
Cc: Vlastimil Babka, Harry Yoo, Andrew Morton, Christoph Lameter,
David Rientjes, Roman Gushchin, linux-mm, linux-kernel
On Wed, Jul 01, 2026 at 02:06:33PM +0000, Seongjun Hong wrote:
> Since the removal of the per-cpu slab in commit 32c894c7274b ("slab:
> remove struct kmem_cache_cpu"), show_slab_objects() no longer has a
> branch handling SO_CPU, so cpu_slabs_show() always produces "0".
>
> Emit "0\n" directly instead, matching the sibling cpu_partial and
> slabs_cpu_partial stubs, and remove the now-unused SO_CPU macro and
> SL_CPU enum value.
>
> No functional change intended; the cpu_slabs sysfs attribute continues
> to read 0.
>
> Signed-off-by: Seongjun Hong <hsj0512@snu.ac.kr>
> ---
Reviewed-by: Hao Li <hao.li@linux.dev>
--
Thanks,
Hao
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] slab: remove unused SL_CPU slab_stat_type
2026-07-01 14:06 [PATCH] slab: remove unused SL_CPU slab_stat_type Seongjun Hong
2026-07-02 4:31 ` Harry Yoo
2026-07-02 6:24 ` Hao Li
@ 2026-07-02 8:15 ` Vlastimil Babka (SUSE)
2 siblings, 0 replies; 4+ messages in thread
From: Vlastimil Babka (SUSE) @ 2026-07-02 8:15 UTC (permalink / raw)
To: Seongjun Hong, Harry Yoo, Andrew Morton
Cc: Hao Li, Christoph Lameter, David Rientjes, Roman Gushchin,
linux-mm, linux-kernel
On 7/1/26 16:06, Seongjun Hong wrote:
> Since the removal of the per-cpu slab in commit 32c894c7274b ("slab:
> remove struct kmem_cache_cpu"), show_slab_objects() no longer has a
> branch handling SO_CPU, so cpu_slabs_show() always produces "0".
>
> Emit "0\n" directly instead, matching the sibling cpu_partial and
> slabs_cpu_partial stubs, and remove the now-unused SO_CPU macro and
> SL_CPU enum value.
>
> No functional change intended; the cpu_slabs sysfs attribute continues
> to read 0.
>
> Signed-off-by: Seongjun Hong <hsj0512@snu.ac.kr>
Applied to slab/for-next, thanks!
> ---
> mm/slub.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/mm/slub.c b/mm/slub.c
> index 9ec774dc7009..f2eb60ce0d23 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -8992,14 +8992,12 @@ static void process_slab(struct loc_track *t, struct kmem_cache *s,
> enum slab_stat_type {
> SL_ALL, /* All slabs */
> SL_PARTIAL, /* Only partially allocated slabs */
> - SL_CPU, /* Only slabs used for cpu caches */
> SL_OBJECTS, /* Determine allocated objects not slabs */
> SL_TOTAL /* Determine object capacity not slabs */
> };
>
> #define SO_ALL (1 << SL_ALL)
> #define SO_PARTIAL (1 << SL_PARTIAL)
> -#define SO_CPU (1 << SL_CPU)
> #define SO_OBJECTS (1 << SL_OBJECTS)
> #define SO_TOTAL (1 << SL_TOTAL)
>
> @@ -9188,7 +9186,7 @@ SLAB_ATTR_RO(partial);
>
> static ssize_t cpu_slabs_show(struct kmem_cache *s, char *buf)
> {
> - return show_slab_objects(s, buf, SO_CPU);
> + return sysfs_emit(buf, "0\n");
> }
> SLAB_ATTR_RO(cpu_slabs);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-02 8:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 14:06 [PATCH] slab: remove unused SL_CPU slab_stat_type Seongjun Hong
2026-07-02 4:31 ` Harry Yoo
2026-07-02 6:24 ` Hao Li
2026-07-02 8:15 ` Vlastimil Babka (SUSE)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox