Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Harry Yoo <harry@kernel.org>
To: Alexey Dobriyan <adobriyan@gmail.com>,
	Vlastimil Babka <vbabka@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Hao Li <hao.li@linux.dev>, Christoph Lameter <cl@gentwo.org>,
	David Rientjes <rientjes@google.com>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	linux-mm@kvack.org
Subject: Re: [PATCH] slub: print just the function name in /sys/kernel/slab/*/ctor
Date: Mon, 27 Jul 2026 14:27:07 +0900	[thread overview]
Message-ID: <ee600151-85d5-4cd2-922c-d2d8df21878c@kernel.org> (raw)
In-Reply-To: <456c0a37-9074-45b5-9be2-a5f2fe345400@p183>


[-- 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 --]

  reply	other threads:[~2026-07-27  5:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]
2026-07-30 14:15   ` Vlastimil Babka (SUSE)
2026-08-02  5:13     ` Harry Yoo
2026-07-27 15:52 ` Christoph Lameter (Ampere)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee600151-85d5-4cd2-922c-d2d8df21878c@kernel.org \
    --to=harry@kernel.org \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=hao.li@linux.dev \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=vbabka@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox