From: John Hubbard <jhubbard@nvidia.com>
To: William Kucharski <william.kucharski@oracle.com>,
Ryan Roberts <ryan.roberts@arm.com>
Cc: Barry Song <21cnbao@gmail.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>,
Alistair Popple <apopple@nvidia.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [RFC PATCH v1] tools/mm: Add thpmaps script to dump THP usage info
Date: Fri, 5 Jan 2024 15:07:45 -0800 [thread overview]
Message-ID: <1cfc9b14-3e58-4366-89f5-0f4b7717008a@nvidia.com> (raw)
In-Reply-To: <E6D86830-032F-40DE-B717-026F99E35ABA@oracle.com>
On 1/5/24 03:30, William Kucharski wrote:
> Personally I like either of these:
>
> 00000206: 0000aaaadbb20000-0000aaaadbb21000 r-xp 00000000 fe:00 00426969
> 206: 0000aaaadbb20000-0000aaaadbb21000 r-xp 00000000 fe:00 00426969
I like that second one, because that's how pids are often printed.
>
> With a header that looks something like this; I suspect the formatting will get
> mangled in email anyway:
>
> PID START END PROT OFF MJ:MN INODE FILE
> 00000206: 0000aaaadbb20000-0000aaaadbb21000 r-xp 00000000 fe:00 00426969
The MJ:MN is mysterious, but this looks good otherwise.
thanks,
--
John Hubbard
NVIDIA
>
> -- William Kucharski
>
>> On Jan 5, 2024, at 01:35, Ryan Roberts <ryan.roberts@arm.com> wrote:
>>
>> On 04/01/2024 22:48, John Hubbard wrote:
>>> On 1/3/24 02:20, Ryan Roberts wrote:
>>>> On 03/01/2024 10:09, William Kucharski wrote:
>>> ...
>>>>>> The reason is that it is also possible to invoke the tool with --cgroup instead
>>>>>> of --pid. In this case, the tool will iterate over all the pids in the
>>>>>> cgroup so
>>>>>> (when --summary is not specified) having the pid associated with each vma is
>>>>>> useful.
>>>>>>
>>>>>> I could change it to conditionally output the pid only when --cgroup is
>>>>>> specified?
>>>>>
>>>>> You could, or perhaps emit a colon after the pid to delineate it, e.g.:
>>>>>
>>>>>> 000000ce: 0000aaaadbb20000-0000aaaadbb21000 r-xp 00000000 fe:0000426969
>>>>>> /root/a.out
>>>>
>>>> Yeah that sounds like the least worst option. Let's go with that.
>>>
>>> I'm trying this out and had the exact same issue with pid. I'd suggest:
>>>
>>> a) pid should always be printed in decimal, because that's what ps(1) uses
>>> and no one expects to see it in other formats such as hex.
>>
>> right aligned with 0 or ' ' as the pad? I guess ' ' if you want it to look like
>> ps? But given pid is the first column, I think it will look weird right aligned.
>> Perhaps left aligned, followed by colon, followed by pad? Here are the 3 options:
>>
>> 00000206: 0000aaaadbb20000-0000aaaadbb21000 r-xp 00000000 fe:00 00426969
>> 206: 0000aaaadbb20000-0000aaaadbb21000 r-xp 00000000 fe:00 00426969
>> 206: 0000aaaadbb20000-0000aaaadbb21000 r-xp 00000000 fe:00 00426969
>>
>> My personal preference is the first option; right aligned with 0 pad.
>>
>>>
>>> b) In fact, perhaps a header row would help. There could be a --no-header-row
>>> option for cases that want to feed this to other scripts, but the default
>>> would be to include a human-friendly header.
>>
>> How about this for a header (with example first data row):
>>
>> PID START END PROT OFF MJ:MN INODE FILE
>> 00000206: 0000aaaadbb20000-0000aaaadbb21000 r-xp 00000000 fe:00 00426969
>>
>> Personally I wouldn't bother with a --no-header option; just keep it always on.
>>
>>>
>>> c) pid should probably be suppressed if --pid is specified, but that's
>>> less important than the other points.
>>
>> If we have the header then I think its clear what it is and I'd prefer to keep
>> the data format consistent between --pid and --cgroup. So prefer to leave pid in
>> always.
>>
>>>
>>> In a day or two I'll get a chance to run this on something that allocates
>>> lots of mTHPs, and give a closer look.
>>
>> Thanks - it would be great to get some feedback on the usefulness of the actual
>> counters! :)
>>
>> I'm considering adding an --ignore-folio-boundaries option, which would modify
>> the way the cont counters work, to only look for contiguity and alignment and
>> ignore any folio boundaries. At the moment, if you have multiple contiguous
>> folios, they don't count, because the memory doesn't all belong to the same
>> folio. I think this could be useful in some (limited) circumstances.
>>
>>>
>>>
>>> thanks,
>
>
next prev parent reply other threads:[~2024-01-05 23:08 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-02 15:38 [RFC PATCH v1] tools/mm: Add thpmaps script to dump THP usage info 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 [this message]
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
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=1cfc9b14-3e58-4366-89f5-0f4b7717008a@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=william.kucharski@oracle.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