All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] slub: print just the function name in /sys/kernel/slab/*/ctor
@ 2026-07-25 13:28 Alexey Dobriyan
  2026-07-27  5:27 ` Harry Yoo
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Dobriyan @ 2026-07-25 13:28 UTC (permalink / raw)
  To: Vlastimil Babka, Harry Yoo, Andrew Morton
  Cc: Hao Li, Christoph Lameter, David Rientjes, Roman Gushchin,
	linux-mm

Sysfs "ctor" file prints offset/length of the cache's ctor function

	$ sudo cat /sys/kernel/slab/bdev_cache/ctor
	init_once+0x0/0x10

This is not useful:

Offset will always be 0 because ctor is a function.

I'm not sure what ctor function size is doing here, it should be in
/proc/kallsyms

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 mm/slub.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/slub.c
+++ b/mm/slub.c
@@ -9149,7 +9149,7 @@ static ssize_t ctor_show(struct kmem_cache *s, char *buf)
 {
 	if (!s->ctor)
 		return 0;
-	return sysfs_emit(buf, "%pS\n", s->ctor);
+	return sysfs_emit(buf, "%ps\n", s->ctor);
 }
 SLAB_ATTR_RO(ctor);
 


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

* Re: [PATCH] slub: print just the function name in /sys/kernel/slab/*/ctor
  2026-07-25 13:28 [PATCH] slub: print just the function name in /sys/kernel/slab/*/ctor Alexey Dobriyan
@ 2026-07-27  5:27 ` Harry Yoo
  0 siblings, 0 replies; 2+ messages in thread
From: Harry Yoo @ 2026-07-27  5:27 UTC (permalink / raw)
  To: Alexey Dobriyan, Vlastimil Babka, Andrew Morton
  Cc: Hao Li, Christoph Lameter, David Rientjes, Roman Gushchin,
	linux-mm


[-- Attachment #1.1: Type: text/plain, Size: 984 bytes --]



On 7/25/26 10:28 PM, Alexey Dobriyan wrote:
> Sysfs "ctor" file prints offset/length of the cache's ctor function
> 
> 	$ sudo cat /sys/kernel/slab/bdev_cache/ctor
> 	init_once+0x0/0x10
> 
> This is not useful:
> 
> Offset will always be 0 because ctor is a function.
> 
> I'm not sure what ctor function size is doing here, it should be in
> /proc/kallsyms
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---

I'm not convinced that changing this (without strong justification)
after exposing it to sysfs for 10+ years is worth the trouble.

>  mm/slub.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -9149,7 +9149,7 @@ static ssize_t ctor_show(struct kmem_cache *s, char *buf)
>  {
>  	if (!s->ctor)
>  		return 0;
> -	return sysfs_emit(buf, "%pS\n", s->ctor);
> +	return sysfs_emit(buf, "%ps\n", s->ctor);
>  }
>  SLAB_ATTR_RO(ctor);
>  

-- 
Cheers,
Harry / Hyeonggon


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

end of thread, other threads:[~2026-07-27  5:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-25 13:28 [PATCH] slub: print just the function name in /sys/kernel/slab/*/ctor Alexey Dobriyan
2026-07-27  5:27 ` Harry Yoo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.