mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Harry Yoo <harry@kernel.org>
To: Seongjun Hong <hsj0512@snu.ac.kr>
Cc: Vlastimil Babka <vbabka@kernel.org>,
	 Andrew Morton <akpm@linux-foundation.org>,
	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,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] tools/mm/slabinfo: report percpu sheaves and barn statistics
Date: Mon, 28 Sep 2026 17:00:37 +0100	[thread overview]
Message-ID: <arqNTeIsjXCcYyxp@thinkstation> (raw)
In-Reply-To: <20260927-tools-mm-update-slabinfo-v1-2-a4ea0d4dc136@snu.ac.kr>

On Sun, Sep 27, 2026 at 05:57:28AM +0000, Seongjun Hong wrote:
> Since commit 2d517aa09bbc ("slab: add opt-in caching layer of percpu
> sheaves") sysfs provides the statistics of sheaf and barn, but slabinfo
> did not utilize this information. Display perf, API, and sheaf allocation
> counters on slabinfo report(-r).
> 
> Example slabinfo report output:
> 
> 	$ slabinfo -r kmalloc-1k
> 
> 	Sheaf capacity             12 objects
> 
> 	Sheaf Perf Counter    Success     Fail
> 	--------------------------------------------------
> 	Barn get                    4       43
> 	Barn put                    4        0
> 	RCU sheaf free             34        0
> 
> 	Sheaf API Counter        Fast     Slow
> 	--------------------------------------------------
> 	Prefill                     0        0
> 	Return                      0        0

You mean "Prefilled Sheaf API Counter"?

> 	Sheaf Objects/Allocations

This doesn't make sense to me.

Perhaps should be separated into
"Sheaf Allocation/Free" and
"Sheaf Refill/Flush" ?


> 	--------------------------------------------------
> 	Objects flushed to slabs             0
> 	Objects refilled into sheaves      516
> 	Sheaves allocated                    7
> 	Sheaves freed                        0
> 	Oversize sheaves for prefill         0
> 
> Signed-off-by: Seongjun Hong <hsj0512@snu.ac.kr>
> ---
>  tools/mm/slabinfo.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 58 insertions(+)
> 
> diff --git a/tools/mm/slabinfo.c b/tools/mm/slabinfo.c
> index 84359d628f2e..dbc72582ffab 100644
> --- a/tools/mm/slabinfo.c
> +++ b/tools/mm/slabinfo.c
> @@ -574,6 +582,39 @@ static void slab_stats(struct slabinfo *s)
>  	}
>  }
>  
> +static void sheaf_stats(struct slabinfo *s)

Perhaps let's fold this into slab_stats()?
I'm not sure why this should be in a separate function.
These files are part of SLUB_STATS files, that are related to sheaves.

-- 
Cheers,
Harry / Hyeonggon

> +{
> +	if (!s->sheaf_capacity)
> +		return;
> +
> +	printf("\nSheaf capacity       %8u objects\n", s->sheaf_capacity);
> +
> +	printf("\nSheaf Perf Counter    Success     Fail\n");
> +	printf("--------------------------------------------------\n");
> +	printf("Barn get             %8lu %8lu\n",
> +		s->barn_get, s->barn_get_fail);
> +	printf("Barn put             %8lu %8lu\n",
> +		s->barn_put, s->barn_put_fail);
> +	printf("RCU sheaf free       %8lu %8lu\n",
> +		s->free_rcu_sheaf, s->free_rcu_sheaf_fail);
> +
> +	printf("\nSheaf API Counter        Fast     Slow\n");
> +	printf("--------------------------------------------------\n");
> +	printf("Prefill              %8lu %8lu\n",
> +		s->sheaf_prefill_fast, s->sheaf_prefill_slow);
> +	printf("Return               %8lu %8lu\n",
> +		s->sheaf_return_fast, s->sheaf_return_slow);
> +
> +	printf("\nSheaf Objects/Allocations\n");
> +	printf("--------------------------------------------------\n");
> +	printf("Objects flushed to slabs      %8lu\n", s->sheaf_flush);
> +	printf("Objects refilled into sheaves %8lu\n", s->sheaf_refill);
> +	printf("Sheaves allocated             %8lu\n", s->sheaf_alloc);
> +	printf("Sheaves freed                 %8lu\n", s->sheaf_free);
> +	printf("Oversize sheaves for prefill  %8lu\n",
> +		s->sheaf_prefill_oversize);
> +}
> +
>  static void report(struct slabinfo *s)
>  {
>  	if (strcmp(s->name, "*") == 0)
> @@ -613,6 +654,7 @@ static void report(struct slabinfo *s)
>  	show_tracking(s);
>  	slab_numa(s, 1);
>  	slab_stats(s);
> +	sheaf_stats(s);
>  }

      reply	other threads:[~2026-09-28 16:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-27  5:57 [PATCH 0/2] tools/mm/slabinfo: report sheaf " Seongjun Hong
2026-09-27  5:57 ` [PATCH 1/2] tools/mm/slabinfo: refactor slab attribute reading Seongjun Hong
2026-09-28 15:52   ` Harry Yoo
2026-09-27  5:57 ` [PATCH 2/2] tools/mm/slabinfo: report percpu sheaves and barn statistics Seongjun Hong
2026-09-28 16:00   ` Harry Yoo [this message]

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=arqNTeIsjXCcYyxp@thinkstation \
    --to=harry@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=hao.li@linux.dev \
    --cc=hsj0512@snu.ac.kr \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®