From: Michal Hocko <mhocko@suse.com>
To: Mauricio Faria de Oliveira <mfo@igalia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@suse.cz>,
Oscar Salvador <osalvador@suse.de>,
Suren Baghdasaryan <surenb@google.com>,
Brendan Jackman <jackmanb@google.com>,
Johannes Weiner <hannes@cmpxchg.org>, Zi Yan <ziy@nvidia.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel-dev@igalia.com
Subject: Re: [PATCH 0/3] mm/page_owner: add options 'print_handle' and 'print_stack' for 'show_stacks'
Date: Thu, 25 Sep 2025 18:08:54 +0200 [thread overview]
Message-ID: <aNVpFn9W0jYYr9vs@tiehlicka> (raw)
In-Reply-To: <20250924174023.261125-1-mfo@igalia.com>
On Wed 24-09-25 14:40:20, Mauricio Faria de Oliveira wrote:
> Problem:
>
> The use case of monitoring the memory usage per stack trace (or tracking
> a particular stack trace) requires uniquely identifying each stack trace.
>
> This has to be done for every stack trace on every sample of monitoring,
> even if tracking only one stack trace (to identify it among all others).
>
> Therefore, an approach like, for example, hashing the stack traces from
> 'show_stacks' for calculating unique identifiers can become expensive.
>
> Solution:
>
> Fortunately, the kernel can provide a unique identifier for stack traces
> in page_owner, which is the handle number in stackdepot.
>
> Additionally, with that information, the stack traces themselves are not
> needed until the time when the memory usage should be associated with a
> stack trace (say, to look at a few top consumers), using handle numbers.
>
> This eliminates hashing and reduces filtering related to stack traces in
> userspace, and reduces text emitted/copied by the kernel.
Let's see if I understand this correctly. You are suggesting trimming
down the output to effectivelly key, value pair and only resolve the key
once per debugging session because keys do not change and you do not
need the full stack traces that maps to the key. Correct?
Could you elaborate some more on why the performance really matters here?
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2025-09-25 16:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-24 17:40 Mauricio Faria de Oliveira
2025-09-24 17:40 ` [PATCH 1/3] mm/page_owner: add option 'print_handle' " Mauricio Faria de Oliveira
2025-09-25 20:28 ` Joshua Hahn
2025-09-25 22:25 ` Mauricio Faria de Oliveira
2025-09-24 17:40 ` [PATCH 2/3] mm/page_owner: add option 'print_stack' " Mauricio Faria de Oliveira
2025-09-24 17:40 ` [PATCH 3/3] mm/page_owner: update Documentation with 'print_handle' and 'print_stack' Mauricio Faria de Oliveira
2025-09-25 16:08 ` Michal Hocko [this message]
2025-09-25 19:38 ` [PATCH 0/3] mm/page_owner: add options 'print_handle' and 'print_stack' for 'show_stacks' Mauricio Faria de Oliveira
2025-09-26 6:55 ` Michal Hocko
2025-09-26 16:47 ` Mauricio Faria de Oliveira
2025-09-30 14:02 ` Michal Hocko
2025-09-30 14:32 ` Mauricio Faria de Oliveira
2025-10-01 10:58 ` Vlastimil Babka
2025-10-01 17:37 ` Mauricio Faria de Oliveira
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=aNVpFn9W0jYYr9vs@tiehlicka \
--to=mhocko@suse.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=jackmanb@google.com \
--cc=kernel-dev@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mfo@igalia.com \
--cc=osalvador@suse.de \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--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