From: Ryan Roberts <ryan.roberts@arm.com>
To: William Kucharski <william.kucharski@oracle.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>,
John Hubbard <jhubbard@nvidia.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: Wed, 3 Jan 2024 10:20:49 +0000 [thread overview]
Message-ID: <c75724fa-408d-4f97-8d93-b938d40964a3@arm.com> (raw)
In-Reply-To: <F56087C9-70B9-4441-8A9E-B2F70F76CE7F@oracle.com>
On 03/01/2024 10:09, William Kucharski wrote:
>
>
>> On Jan 3, 2024, at 02:35, Ryan Roberts <ryan.roberts@arm.com> wrote:
>>
>> On 03/01/2024 09:16, Barry Song wrote:
>>> On Wed, Jan 3, 2024 at 9:25 PM Ryan Roberts <ryan.roberts@arm.com> wrote:
>>>>
>>>> On 03/01/2024 08:07, William Kucharski wrote:
>>>>>
>>>>>> On Jan 2, 2024, at 23:44, Barry Song <21cnbao@gmail.com> wrote:
>>>>>>
>>>>>> Hi Ryan,
>>>>>>
>>>>>> I ran a couple of test cases with different parameters, it seems to
>>>>>> work correctly.
>>>>>> just i don't understand the below, what is the meaning of 000000ce at
>>>>>> the beginning of
>>>>>> each line?
>>>>>
>>>>> It's the pid; 0xce is the specified pid, 206.
>>>>
>>>> Yes indeed. I added the pid to the front for the case where you are using
>>>> --cgroup without --summary; in that case, each vma will be printed for each pid
>>>> in the cgroup and it seemed sensible to be able to see which pid each vma
>>>> belonged to.
>>>
>>> I don't understand why we have to add the pid before each line as this tool
>>> already has pid in the parameter :-)
>>
>> 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.
>
> but then some people would probably read it as a memory address, so who knows.
>
> -- William Kucharski
>
>>
>>> this seems like duplicated information
>>> to me. but it doesn't matter too much as this tool is really nice though it is
>>> not so easy to deploy on Android.
>>
>> Hmm. I've seen tutorials where people have Python running under Android, but I
>> agree its not zero effort. Perhaps it would be better in C. Unfortuantely, I
>> can't commit to doing a port at this point.
>>
>>>
>>> Please feel free to add,
>>>
>>> Tested-by: Barry Song <v-songbaohua@oppo.com>
>>
>> Thanks!
>>
>>>
>>>>
>>>>>
>>>>> Perhaps the pid should be printed in decimal?
>>>>
>>>> I thought about printing in decimal, but every other value in the vma is in hex
>>>> without a leading "0x" (I'm trying to follow the smaps convention). So I thought
>>>> it could be more confusing in decimal.
>>>>
>>>> I'm happy to change it to decimal if that's the preference though? Although I'd
>>>> like to continue to present it in a fixed width field, padded with 0s on the
>>>> left so that everything lines up.
>>>>
>>>>>
>>>>> -- William Kucharski
>>>>>
>>>>>> /thpmaps --pid 206 --cont 64K
>>>>>> 000000ce 0000aaaadbb20000-0000aaaadbb21000 r-xp 00000000 fe:00
>>>>>> 00426969 /root/a.out
>>>>>> 000000ce 0000aaaadbb3f000-0000aaaadbb40000 r--p 0000f000 fe:00
>>>>>> 00426969 /root/a.out
>>>>>> 000000ce 0000aaaadbb40000-0000aaaadbb41000 rw-p 00010000 fe:00
>>>>>> 00426969 /root/a.out
>>>>>> 000000ce 0000ffff702c0000-0000ffffb02c0000 rw-p 00000000 00:00 00000000
>>>>>> anon-thp-aligned-64kB: 473920 kB (100%)
>>>>>> anon-cont-aligned-64kB: 473920 kB (100%)
>>>>>> 000000ce 0000ffffb02c0000-0000ffffb044c000 r-xp 00000000 fe:00
>>>>>> 00395429 /usr/lib/aarch64-linux-gnu/libc.so.6
>>>>>> 000000ce 0000ffffb044c000-0000ffffb045d000 ---p 0018c000 fe:00
>>>>>> 00395429 /usr/lib/aarch64-linux-gnu/libc.so.6
>>>>>> 000000ce 0000ffffb045d000-0000ffffb0460000 r--p 0018d000 fe:00
>>>>>> 00395429 /usr/lib/aarch64-linux-gnu/libc.so.6
>>>>>> 000000ce 0000ffffb0460000-0000ffffb0462000 rw-p 00190000 fe:00
>>>>>> 00395429 /usr/lib/aarch64-linux-gnu/libc.so.6
>>>>>> 000000ce 0000ffffb0462000-0000ffffb046f000 rw-p 00000000 00:00 00000000
>>>>>> 000000ce 0000ffffb0477000-0000ffffb049d000 r-xp 00000000 fe:00
>>>>>> 00393893 /usr/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1
>>>>>> 000000ce 0000ffffb04b0000-0000ffffb04b2000 rw-p 00000000 00:00 00000000
>>>>>> 000000ce 0000ffffb04b2000-0000ffffb04b4000 r--p 00000000 00:00 00000000 [vvar]
>>>>>> 000000ce 0000ffffb04b4000-0000ffffb04b5000 r-xp 00000000 00:00 00000000 [vdso]
>>>>>> 000000ce 0000ffffb04b5000-0000ffffb04b7000 r--p 0002e000 fe:00
>>>>>> 00393893 /usr/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1
>>>>>> 000000ce 0000ffffb04b7000-0000ffffb04b9000 rw-p 00030000 fe:00
>>>>>> 00393893 /usr/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1
>>>>>> 000000ce 0000ffffdaba4000-0000ffffdabc5000 rw-p 00000000 00:00 00000000 [stack]
>>>>>
>>>
>>> Thanks
>>> Barry
>>
>>
>
next prev parent reply other threads:[~2024-01-03 10:20 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 [this message]
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
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=c75724fa-408d-4f97-8d93-b938d40964a3@arm.com \
--to=ryan.roberts@arm.com \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=david@redhat.com \
--cc=jhubbard@nvidia.com \
--cc=linux-mm@kvack.org \
--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