linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pasha Tatashin <pasha.tatashin@soleen.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"jpoimboe@kernel.org" <jpoimboe@kernel.org>,
	 "kent.overstreet@linux.dev" <kent.overstreet@linux.dev>,
	"peterz@infradead.org" <peterz@infradead.org>,
	 "nphamcs@gmail.com" <nphamcs@gmail.com>,
	 "cerasuolodomenico@gmail.com" <cerasuolodomenico@gmail.com>,
	"surenb@google.com" <surenb@google.com>,
	 "lizhijian@fujitsu.com" <lizhijian@fujitsu.com>,
	"willy@infradead.org" <willy@infradead.org>,
	 "shakeel.butt@linux.dev" <shakeel.butt@linux.dev>,
	"vbabka@suse.cz" <vbabka@suse.cz>,
	 "ziy@nvidia.com" <ziy@nvidia.com>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH] vmstat: Keep count of the maximum page reached by the kernel stack
Date: Thu, 14 Mar 2024 09:42:05 -0400	[thread overview]
Message-ID: <CA+CK2bBdJ6RcSdqfE+EkmxgnVnzpRvE+Vz3PUbvYHEHbAQs2NQ@mail.gmail.com> (raw)
In-Reply-To: <7af73776-06f9-42e6-9bfc-fabe8f8b002e@csgroup.eu>

On Thu, Mar 14, 2024 at 4:19 AM Christophe Leroy
<christophe.leroy@csgroup.eu> wrote:
>
>
>
> Le 13/03/2024 à 04:34, Pasha Tatashin a écrit :
> > CONFIG_DEBUG_STACK_USAGE provides a mechanism to know the minimum amount
> > of memory that was left in stack. Every time the new anti-record is
> > reached a message is printed to the console.
> >
> > However, this is not useful to know how much each page within stack was
> > actually used. Provide a mechanism to count the number of time each
> > stack page was reached throughout the live of the stack:
>
> by "this is not useful to know ", you mean "this does not allow us to
> know" ?

Yes, bad wording from my side, I will change it to you suggestion in
the next version.

>
> >
> >       $
> >       kstack_page_1 19974
> >       kstack_page_2 94
> >       kstack_page_3 0
> >       kstack_page_4 0
>
> That's probably only usefull when THREAD_SIZE is larger than PAGE_SIZE.

That is right, if THREAD_SIZE <= PAGE_SIZE, only "kstack_page_1" would
be filled.

>
> On powerpc 8xx, THREAD_SIZE is 8k by default and PAGE_SIZE can be either
> 4k or 16k.

With THREAD_SIZE == 8K, and  PAGE_SIZE = 4K
There will be  two counters in /proc/vmstat, something like this:

kstack_page_1 XXX
kstack_page_2 YYY

With THREAD_SIZE=16K, and PAGE_SIZE = 16K
There will be two counters, but one will always be zero:

kstack_page_1 XXX
kstack_page_2 0

Thanks,
Pasha


      reply	other threads:[~2024-03-14 13:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13  3:34 Pasha Tatashin
2024-03-13  3:39 ` Pasha Tatashin
2024-03-14  8:19 ` Christophe Leroy
2024-03-14 13:42   ` Pasha Tatashin [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=CA+CK2bBdJ6RcSdqfE+EkmxgnVnzpRvE+Vz3PUbvYHEHbAQs2NQ@mail.gmail.com \
    --to=pasha.tatashin@soleen.com \
    --cc=akpm@linux-foundation.org \
    --cc=cerasuolodomenico@gmail.com \
    --cc=christophe.leroy@csgroup.eu \
    --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