From: Pasha Tatashin <pasha.tatashin@soleen.com>
To: Shakeel Butt <shakeel.butt@linux.dev>
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: Wed, 17 Jul 2024 12:50:00 -0400 [thread overview]
Message-ID: <CA+CK2bBm4COW+jZifyjFEyJNcW1cAXWYzCpuO81jL3YziKxfRw@mail.gmail.com> (raw)
In-Reply-To: <usfcwyq76np42s5b2rpzgjrvvtdpwakaum7ayy4zumaa73ke3u@txbukb2464bl>
On Wed, Jun 12, 2024 at 2:50 PM Shakeel Butt <shakeel.butt@linux.dev> wrote:
>
>
> Hi Pasha, I think you might have missed the questions I had below. Your
> response would really be appreciated.
Hi Shakeel,
Sorry for the delayed reply. I was distracted by unrelated tasks and
did not make any progress on this project. To answer your questions:
>
> On Fri, May 31, 2024 at 03:42:34PM GMT, Shakeel Butt wrote:
> > On Thu, May 30, 2024 at 08:14:17PM GMT, Pasha Tatashin wrote:
> > > Hi Shakeel,
> > >
> > > > 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)
> > >
> > > It depends on how on-demand allocation is implemented. On hardware
> > > that supports faults on kernel stacks,
> >
> > Which hardware supports faults on kernel stacks and which do not?
From my understanding, both ARM64 architecture is capable and also
Intel FRED is capable of handling kernel faults within the kernel
itself, other variants of x86-64 are not.
However, my immediate goal is to provide a generic way to increase
kernel thread memory on demand, specifically when needed. If certain
architectures are capable of in-kernel fault handling, they could
potentially leverage my framework to further enhance their dynamic
stack fault handling support.
> >
> > > we will have other metrics that
> > > show the total number of pages allocated for stacks.
> >
> > Don't we already have a metric for that i.e. KernelStack in meminfo
> > which is in kB unit?
If we had true dynamic kernel stack support, then the metric in
meminfo would be enough to estimate the average stack size, it would
still not show the histogram of how large stacks get.
> >
> > One more question: Is there any concern in making
> > CONFIG_DEBUG_STACK_USAGE not a debug feature i.e. enable in default
> > kernels instead of just debug kernels?
We enabled it in Google ProdKernel. There is some overhead when
threads are exiting, because we are looking for the first non-zero
byte, but that is minimal. We haven't observed any performance impact
on our fleet.
Pasha
next prev parent reply other threads:[~2024-07-17 16:50 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
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 [this message]
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=CA+CK2bBm4COW+jZifyjFEyJNcW1cAXWYzCpuO81jL3YziKxfRw@mail.gmail.com \
--to=pasha.tatashin@soleen.com \
--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=peterz@infradead.org \
--cc=shakeel.butt@linux.dev \
--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