From: John Hubbard <jhubbard@nvidia.com>
To: Ryan Roberts <ryan.roberts@arm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Zenghui Yu <yuzenghui@huawei.com>,
"Matthew Wilcox" <willy@infradead.org>,
David Hildenbrand <david@redhat.com>,
"Kefeng Wang" <wangkefeng.wang@huawei.com>,
Zi Yan <ziy@nvidia.com>, Barry Song <21cnbao@gmail.com>,
Alistair Popple <apopple@nvidia.com>
Cc: <linux-mm@kvack.org>
Subject: Re: [RFC PATCH v1] tools/mm: Add thpmaps script to dump THP usage info
Date: Tue, 9 Jan 2024 19:34:57 -0800 [thread overview]
Message-ID: <4e7445a0-acc9-487f-999f-a2b6d03d265e@nvidia.com> (raw)
In-Reply-To: <20240102153828.1002295-1-ryan.roberts@arm.com>
On 1/2/24 07:38, Ryan Roberts wrote:
> With the proliferation of large folios for file-backed memory, and more
> recently the introduction of multi-size THP for anonymous memory, it is
> becoming useful to be able to see exactly how large folios are mapped
> into processes. For some architectures (e.g. arm64), if most memory is
> mapped using contpte-sized and -aligned blocks, TLB usage can be
> optimized so it's useful to see where these requirements are and are not
> being met.
>
> thpmaps is a Python utility that reads /proc/<pid>/smaps,
> /proc/<pid>/pagemap and /proc/kpageflags to print information about how
> transparent huge pages (both file and anon) are mapped to a specified
> process or cgroup. It aims to help users debug and optimize their
> workloads. In future we may wish to introduce stats directly into the
> kernel (e.g. smaps or similar), but for now this provides a short term
> solution without the need to introduce any new ABI.
>
...
> I've found this very useful for debugging, and I know others have requested a
> way to check if mTHP and contpte is working, so thought this might a good short
> term solution until we figure out how best to add stats in the kernel?
>
Hi Ryan,
One thing that immediately came up during some recent testing of mTHP
on arm64: the pid requirement is sometimes a little awkward. I'm running
tests on a machine at a time for now, inside various containers and
such, and it would be nice if there were an easy way to get some numbers
for the mTHPs across the whole machine.
I'm not sure if that changes anything about thpmaps here. Probably
this is fine as-is. But I wanted to give some initial reactions from
just some quick runs: the global state would be convenient.
thanks,
--
John Hubbard
NVIDIA
next prev parent reply other threads:[~2024-01-10 3:35 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-02 15:38 Ryan Roberts
2024-01-03 6:44 ` Barry Song
2024-01-03 8:07 ` William Kucharski
2024-01-03 8:24 ` Ryan Roberts
2024-01-03 9:16 ` Barry Song
2024-01-03 9:35 ` Ryan Roberts
2024-01-03 10:09 ` William Kucharski
2024-01-03 10:20 ` Ryan Roberts
2024-01-04 22:48 ` John Hubbard
2024-01-05 8:35 ` Ryan Roberts
2024-01-05 11:30 ` William Kucharski
2024-01-05 23:07 ` John Hubbard
2024-01-05 23:18 ` John Hubbard
2024-01-10 8:43 ` Ryan Roberts
2024-01-05 8:40 ` Ryan Roberts
2024-01-10 3:34 ` John Hubbard [this message]
2024-01-10 3:51 ` Barry Song
2024-01-10 4:15 ` John Hubbard
2024-01-10 8:02 ` Barry Song
2024-01-10 8:58 ` Ryan Roberts
2024-01-10 9:09 ` Barry Song
2024-01-10 9:20 ` Ryan Roberts
2024-01-10 10:23 ` Ryan Roberts
2024-01-10 10:30 ` Barry Song
2024-01-10 10:38 ` Ryan Roberts
2024-01-10 10:42 ` David Hildenbrand
2024-01-10 10:55 ` Ryan Roberts
2024-01-10 11:00 ` David Hildenbrand
2024-01-10 11:20 ` Ryan Roberts
2024-01-10 11:24 ` David Hildenbrand
2024-01-10 11:38 ` Barry Song
2024-01-10 11:59 ` Ryan Roberts
2024-01-10 12:05 ` Barry Song
2024-01-10 12:12 ` David Hildenbrand
2024-01-10 15:19 ` Zi Yan
2024-01-10 15:27 ` David Hildenbrand
2024-01-10 22:14 ` Barry Song
2024-01-11 12:25 ` Ryan Roberts
2024-01-11 13:18 ` David Hildenbrand
2024-01-11 20:21 ` Barry Song
2024-01-11 20:28 ` David Hildenbrand
2024-01-12 6:03 ` Barry Song
2024-01-12 10:44 ` Ryan Roberts
2024-01-12 10:18 ` Ryan Roberts
2024-01-17 15:49 ` David Hildenbrand
2024-01-11 20:45 ` Barry Song
2024-01-12 10:25 ` Ryan Roberts
2024-01-10 23:34 ` Barry Song
2024-01-10 10:48 ` Barry Song
2024-01-10 10:54 ` David Hildenbrand
2024-01-10 10:58 ` Ryan Roberts
2024-01-10 11:02 ` David Hildenbrand
2024-01-10 11:07 ` Barry Song
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=4e7445a0-acc9-487f-999f-a2b6d03d265e@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=david@redhat.com \
--cc=linux-mm@kvack.org \
--cc=ryan.roberts@arm.com \
--cc=wangkefeng.wang@huawei.com \
--cc=willy@infradead.org \
--cc=yuzenghui@huawei.com \
--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