From: Shakeel Butt <shakeel.butt@linux.dev>
To: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: akpm@linux-foundation.org, jpoimboe@kernel.org,
kent.overstreet@linux.dev, peterz@infradead.org,
nphamcs@gmail.com, cerasuolodomenico@gmail.com,
surenb@google.com, lizhijian@fujitsu.com, willy@infradead.org,
vbabka@suse.cz, ziy@nvidia.com, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH v3] vmstat: Kernel stack usage histogram
Date: Thu, 30 May 2024 14:56:56 -0700 [thread overview]
Message-ID: <cq7537bswpnbsmeiw3rh4ffrgqky4iufsaurukpk2flxts6jcu@6ctttkclvf3f> (raw)
In-Reply-To: <20240530170259.852088-1-pasha.tatashin@soleen.com>
Hi Pasha,
On Thu, May 30, 2024 at 05:02:59PM GMT, Pasha Tatashin wrote:
> Provide a kernel stack usage histogram to aid in optimizing kernel stack
> sizes and minimizing memory waste in large-scale environments. The
> histogram divides stack usage into power-of-two buckets and reports the
> results in /proc/vmstat. This information is especially valuable in
> environments with millions of machines, where even small optimizations
> can have a significant impact.
>
> The histogram data is presented in /proc/vmstat with entries like
> "kstack_1k", "kstack_2k", and so on, indicating the number of threads
> that exited with stack usage falling within each respective bucket.
>
> Example outputs:
> Intel:
> $ grep kstack /proc/vmstat
> kstack_1k 3
> kstack_2k 188
> kstack_4k 11391
> kstack_8k 243
> kstack_16k 0
>
> ARM with 64K page_size:
> $ grep kstack /proc/vmstat
> kstack_1k 1
> kstack_2k 340
> kstack_4k 25212
> kstack_8k 1659
> kstack_16k 0
> kstack_32k 0
> kstack_64k 0
>
> Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Couple of questions:
1. In future with your on-demand kstack allocation feature, will these
metrics still be useful? (I think so but I want to know your take)
2. With on-demand kstack allocation, the stack_not_used() needs to be
changed to not cause the allocation, right?
3. Does the histogram get updated on exit only? What about long running
kernel threads whose will never exit?
thanks,
Shakeel
next prev parent reply other threads:[~2024-05-30 21:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-30 17:02 Pasha Tatashin
2024-05-30 21:56 ` Shakeel Butt [this message]
2024-05-31 0:14 ` Pasha Tatashin
2024-05-31 22:42 ` Shakeel Butt
2024-06-12 18:50 ` Shakeel Butt
2024-07-17 16:50 ` Pasha Tatashin
2024-07-18 23:19 ` Shakeel Butt
2024-07-19 2:56 ` Pasha Tatashin
2024-07-20 3:41 ` David Rientjes
2024-06-01 0:38 ` Andrew Morton
2024-06-06 0:03 ` Pasha Tatashin
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=cq7537bswpnbsmeiw3rh4ffrgqky4iufsaurukpk2flxts6jcu@6ctttkclvf3f \
--to=shakeel.butt@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=cerasuolodomenico@gmail.com \
--cc=jpoimboe@kernel.org \
--cc=kent.overstreet@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizhijian@fujitsu.com \
--cc=nphamcs@gmail.com \
--cc=pasha.tatashin@soleen.com \
--cc=peterz@infradead.org \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
--cc=ziy@nvidia.com \
/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