From: Will Deacon <will@kernel.org>
To: Yang Shi <yang@os.amperecomputing.com>
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: [v7 PATCH] arm64: mm: show direct mapping use in /proc/meminfo
Date: Tue, 2 Jun 2026 15:51:54 +0100 [thread overview]
Message-ID: <ah7uCj2V11MnAlaR@willie-the-truck> (raw)
In-Reply-To: <20260519163657.1259416-1-yang@os.amperecomputing.com>
On Tue, May 19, 2026 at 09:36:57AM -0700, 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.
> 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
>
> Although just the machines which support BBML2_NOABORT can split the
> direct mapping, show it on all machines regardless of BBML2_NOABORT so
> that the users have consistent view in order to avoid confusion.
>
> Although ptdump also can tell the direct map use, but it needs to dump
> the whole kernel page table. It is costly and overkilling. It is also
> in debugfs which may not be enabled by all distros. So showing direct
> map use in /proc/meminfo seems more convenient and has less overhead.
>
> Signed-off-by: Yang Shi <yang@os.amperecomputing.com>
> ---
> arch/arm64/mm/mmu.c | 192 +++++++++++++++++++++++++++++++++++++++-----
> 1 file changed, 171 insertions(+), 21 deletions(-)
>
> v7: * Rebased to v7.1-rc4
> * Changed "dm" to "lm" to follow ARM convention per Will
> * Used __is_lm_alias() instead of reinventing a new helper per Will
Thanks, but Sashiko has pointed out a few nasty issues:
https://sashiko.dev/#/patchset/20260519163657.1259416-1-yang@os.amperecomputing.com
In particular, the potential for races updating the shared counters and
double-accounting of entries due to permission changes look like
interesting things to check.
Will
next prev parent reply other threads:[~2026-06-02 14:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 16:36 Yang Shi
2026-05-22 16:22 ` Christoph Lameter (Ampere)
2026-06-02 14:51 ` Will Deacon [this message]
2026-06-02 20:38 ` Yang Shi
2026-06-08 22:47 ` 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=ah7uCj2V11MnAlaR@willie-the-truck \
--to=will@kernel.org \
--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=yang@os.amperecomputing.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
all inboxes | Powered by JetHome®