Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	Catalin Marinas <catalin.marinas@arm.com>,
	Ryan Roberts <ryan.roberts@arm.com>,
	David Hildenbrand <david@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64/mm: Rename PGD_SIZE as PGD_TABLE_SIZE
Date: Wed, 15 Jul 2026 13:56:13 +0100	[thread overview]
Message-ID: <aleDbfbBpFmXVZJH@willie-the-truck> (raw)
In-Reply-To: <20260714043050.2984188-1-anshuman.khandual@arm.com>

On Tue, Jul 14, 2026 at 10:00:50AM +0530, Anshuman Khandual wrote:
> PXD_SIZE represents the virtual address range size covered by a single page
> table entry on a given page table level. On arm64 PGD entry address span is
> represented with PGDIR_XXX macros instead while PGD_SIZE has been referring
> to size of the PGD table itself. So PGD_SIZE has been some what confusing.
> 
> Rename PGD_SIZE as PGD_TABLE_SIZE making it explicit that it represents PGD
> table size rather than virtual address range covered by a single PGD entry.
> While here, also move PGD_TABLE_SIZE inside pgtable-hwdef.h header.
> 
> No functional change.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Ryan Roberts <ryan.roberts@arm.com>
> Cc: David Hildenbrand (Arm) <david@kernel.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
>  arch/arm64/include/asm/pgalloc.h       | 2 --
>  arch/arm64/include/asm/pgtable-hwdef.h | 1 +
>  arch/arm64/mm/mmu.c                    | 2 +-
>  arch/arm64/mm/pgd.c                    | 6 +++---
>  4 files changed, 5 insertions(+), 6 deletions(-)

I'm not disagreeing that we have an inconsistency here, but does this
patch series help in any meaningful way? Firstly, folks are probably
pretty used to the current (inconsistent) terminology by now and,
secondly, I think the main problem is that we have both PGDIR* and PGD*
based constants, so adding a PGD_TABLE_SIZE just makes things more
confusing. Worse, this exists even in core code:

  include/linux/pgtable.h:
	#define pgd_index(a)  (((a) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))

so I would argue that, if you wanted to repaint all of this, that would
be the place to start, not by making the arm64 even weirder.

Personally, though, I'd leave it all alone because I not a big fan of
this sort of churn in isolation.

Will


  reply	other threads:[~2026-07-15 12:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14  4:30 [PATCH] arm64/mm: Rename PGD_SIZE as PGD_TABLE_SIZE Anshuman Khandual
2026-07-15 12:56 ` Will Deacon [this message]
2026-07-16  4:38   ` Anshuman Khandual

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=aleDbfbBpFmXVZJH@willie-the-truck \
    --to=will@kernel.org \
    --cc=anshuman.khandual@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=david@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ryan.roberts@arm.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