From: David Rientjes <rientjes@google.com>
To: Harry Yoo <harry.yoo@oracle.com>
Cc: Vlastimil Babka <vbabka@suse.cz>,
Christoph Lameter <cl@linux.com>,
linux-mm@kvack.org
Subject: Re: [RFC v1 1/2] mm/slab: add sheaves_enabled read-only sysfs file
Date: Tue, 8 Apr 2025 19:45:38 -0700 (PDT) [thread overview]
Message-ID: <e8811d28-fec6-d707-1418-224911edd986@google.com> (raw)
In-Reply-To: <20250407041810.13861-2-harry.yoo@oracle.com>
On Mon, 7 Apr 2025, Harry Yoo wrote:
> For user-space tools like slabinfo, it is difficult to determine whether
> a cache has sheaves enabled. Expose a read-only 'sheaves_enabled' sysfs
> file to indicate whether sheaves are enabled for a given cache.
>
Thoughts on adding an entry to Documentation/ABI/testing/sysfs-kernel-slab
for this one?
> Signed-off-by: Harry Yoo <harry.yoo@oracle.com>
> ---
> mm/slub.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/mm/slub.c b/mm/slub.c
> index b5ea66cbbe68..32db440a8b05 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -8504,6 +8504,15 @@ static ssize_t remote_node_defrag_ratio_store(struct kmem_cache *s,
> SLAB_ATTR(remote_node_defrag_ratio);
> #endif
>
> +static ssize_t sheaves_enabled_show(struct kmem_cache *s, char *buf)
> +{
> + if (s->cpu_sheaves)
> + return sysfs_emit(buf, "%u\n", 1);
> + else
> + return sysfs_emit(buf, "%u\n", 0);
> +}
> +SLAB_ATTR_RO(sheaves_enabled);
> +
> #ifdef CONFIG_SLUB_STATS
> static int show_stat(struct kmem_cache *s, char *buf, enum stat_item si)
> {
> @@ -8656,6 +8665,7 @@ static struct attribute *slab_attrs[] = {
> #ifdef CONFIG_NUMA
> &remote_node_defrag_ratio_attr.attr,
> #endif
> + &sheaves_enabled_attr.attr,
> #ifdef CONFIG_SLUB_STATS
> &alloc_cpu_sheaf_attr.attr,
> &alloc_fastpath_attr.attr,
> --
> 2.43.0
>
>
next prev parent reply other threads:[~2025-04-09 2:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-07 4:18 [RFC v1 0/2] slabinfo: sheaves statistics support Harry Yoo
2025-04-07 4:18 ` [RFC v1 1/2] mm/slab: add sheaves_enabled read-only sysfs file Harry Yoo
2025-04-09 2:45 ` David Rientjes [this message]
2025-04-10 22:32 ` Harry Yoo
2025-04-23 14:24 ` Vlastimil Babka
2025-04-07 4:18 ` [RFC v1 2/2] tools/mm/slabinfo: add support for sheaves stats Harry Yoo
2025-04-07 4:37 ` [RFC v1 0/2] slabinfo: sheaves statistics support Harry Yoo
2025-04-23 14:28 ` Vlastimil Babka
2025-04-25 8:16 ` Harry Yoo
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=e8811d28-fec6-d707-1418-224911edd986@google.com \
--to=rientjes@google.com \
--cc=cl@linux.com \
--cc=harry.yoo@oracle.com \
--cc=linux-mm@kvack.org \
--cc=vbabka@suse.cz \
/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