From: Yang Shi <yang@os.amperecomputing.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>,
Will Deacon <will@kernel.org>
Cc: catalin.marinas@arm.com, ryan.roberts@arm.com, cl@gentwo.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [v5 PATCH] arm64: mm: show direct mapping use in /proc/meminfo
Date: Fri, 23 Jan 2026 12:08:07 -0800 [thread overview]
Message-ID: <1d9e2eff-c6c9-414d-9e39-e046fc0fdc16@os.amperecomputing.com> (raw)
In-Reply-To: <8e9f762f-5933-4e30-ab6d-489a56de4eaf@arm.com>
On 1/22/26 6:40 PM, Anshuman Khandual wrote:
>
> On 22/01/26 7:47 PM, Will Deacon wrote:
>> On Thu, Jan 22, 2026 at 10:39:25AM +0530, Anshuman Khandual wrote:
>>> Hello Yang,
>>>
>>> On 07/01/26 5:59 AM, Yang Shi wrote:
>>>> Since commit a166563e7ec3 ("arm64: mm: support large block mapping when
>>>> rodata=full"), the direct mapping may be split on some machines instead
>>>> keeping static since boot. It makes more sense to show the direct mapping
>>>> use in /proc/meminfo than before.
>>> I guess the direct mapping here refers to linear map ? IIUC it is called
>>> direct map on x86 and linear map on arm64 platforms. Then should not it
>>> be renamed as s/DirectMap/LinearMap instead ? This will align with names
>>> from ptdump as well.
>>>
>>> Before the above mentioned commit, linear could get altered with memory
>>> hotplug and remove events as well.
>>>
>>>> This patch will make /proc/meminfo show the direct mapping use like the
>>>> below (4K base page size):
>>>> DirectMap4K: 94792 kB
>>>> DirectMap64K: 134208 kB
>>>> DirectMap2M: 1173504 kB
>>>> DirectMap32M: 5636096 kB
>>>> DirectMap1G: 529530880 kB
>>> If /proc/meminfo interface is getting updated via arch_report_meminfo()
>>> why not add stats for all kernel virtual address space ranges including
>>> vmemmap, vmalloc etc aka all address range headers in ptdump as many of
>>> those could change during system runtime. What makes linear mapping any
>>> special ?
>> tbh, I think compatability with x86 is a good argument in this case and
>> so the naming and formatting proposed by this patch makes sense to me.
> Fair enough. Probably adding a comment above arch_report_meminfo() along
> with the commit message, explaining the above rationale would be helpful
> for developers to understand/recollect this equivalence later on.
>
>> I'm also not sure that it's particularly interesting to see these
>> rolled-up numbers for the vmalloc area. You really want information
>> about the area, so extending /proc/vmallocinfo to give information
>> about the granule size for each entry might be useful but I don't think
>> it should be part of this patch.
> Agreed - vmalloc has a separate file for its details which can be improved
> later to accommodate rolled-up numbers. But what about vmemmap ? It always
> gets updated along with linear map during memory hotplug and remove events.
> Should that be included here ?
The granule size of vmemmap should be quite static IIUC. AFAIK kernel
doesn't modify vmemmap page tables except HVO, but arm64 doesn't support
HVO. And just 4K page size can have PMD mapped vmemmap. It doesn't use
contiguous mapping either. The smallest granularity of memory hotplug is
128M with 4K page size, so vmemmap for hotplugged memory should be PMD
mapped as well.
It might be worth showing the memory consumed by vmemmap for hotplug
memory so that the users can know where the memory is used. The vmemmap
used for bootmem is not counted in MemTotal of /proc/meminfo. But it
sounds more core mm generic and shouldn't be part of this patch IMHO.
Thanks,
Yang
next prev parent reply other threads:[~2026-01-23 20:08 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-07 0:29 [v5 PATCH] arm64: mm: show direct mapping use in /proc/meminfo Yang Shi
2026-01-07 18:38 ` Christoph Lameter (Ampere)
2026-01-13 14:36 ` Will Deacon
2026-01-14 0:36 ` Yang Shi
2026-01-21 0:17 ` Yang Shi
2026-01-26 14:18 ` Will Deacon
2026-01-26 17:59 ` Yang Shi
2026-01-21 17:23 ` Ryan Roberts
2026-01-21 22:44 ` Yang Shi
2026-01-22 14:43 ` Ryan Roberts
2026-01-22 21:59 ` Yang Shi
2026-01-26 14:14 ` Will Deacon
2026-01-26 17:55 ` Yang Shi
2026-01-26 18:58 ` Will Deacon
2026-01-26 20:50 ` Yang Shi
2026-01-27 8:57 ` Ryan Roberts
2026-01-28 0:50 ` Yang Shi
2026-01-22 5:09 ` Anshuman Khandual
2026-01-22 14:17 ` Will Deacon
2026-01-23 2:40 ` Anshuman Khandual
2026-01-23 20:08 ` Yang Shi [this message]
2026-01-26 12:44 ` Will Deacon
2026-01-22 19:48 ` Yang Shi
2026-01-22 21:41 ` Yang Shi
2026-01-23 18:42 ` Yang Shi
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=1d9e2eff-c6c9-414d-9e39-e046fc0fdc16@os.amperecomputing.com \
--to=yang@os.amperecomputing.com \
--cc=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=cl@gentwo.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ryan.roberts@arm.com \
--cc=will@kernel.org \
/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