[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f3868f40-961d-4db5-af2a-7b4b32b3d86e@arm.com>
Date: Fri, 21 Mar 2025 09:51:52 +0530
From: Anshuman Khandual <anshuman.khandual@....com>
To: Peter Xu <peterx@...hat.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Alex Williamson <alex.williamson@...hat.com>,
Donald Dutile <ddutile@...hat.com>, Catalin Marinas
<catalin.marinas@....com>, Will Deacon <will@...nel.org>,
Keith Busch <kbusch@...nel.org>
Subject: Re: [PATCH] mm/arm64: Drop dead code for pud special bit handling
On 3/21/25 00:04, Peter Xu wrote:
> Keith Busch observed some incorrect macros defined in arm64 code [1].
>
> It turns out the two lines should never be needed and won't be exposed to
> anyone, because aarch64 doesn't select HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD,
> hence ARCH_SUPPORTS_PUD_PFNMAP is always N. The only archs that support
> THP PUDs so far are x86 and powerpc.
Correct.
>
> Instead of fixing the lines (with no way to test it..), remove the two
> lines that are in reality dead code, to avoid confusing readers.
Agreed. Because ARCH_SUPPORTS_PUD_PFNMAP is always N and hence these lines
are never reachable. So removing these lines will be preferred than fixing.
>
> Fixes tag is attached to reflect where the wrong macros were introduced,
> but explicitly not copying stable, because there's no real issue to be
> fixed. So it's only about removing the dead code so far.
Makes sense.
>
> [1] https://lore.kernel.org/all/Z9tDjOk-JdV_fCY4@kbusch-mbp.dhcp.thefacebook.com/#t
>
> Cc: Alex Williamson <alex.williamson@...hat.com>
> Cc: Donald Dutile <ddutile@...hat.com>
> Cc: Catalin Marinas <catalin.marinas@....com>
> Cc: Will Deacon <will@...nel.org>
> Fixes: 3e509c9b03f9 ("mm/arm64: support large pfn mappings")
The commit ID checks out.
> Reported-by: Keith Busch <kbusch@...nel.org>
> Signed-off-by: Peter Xu <peterx@...hat.com>
> ---
> arch/arm64/include/asm/pgtable.h | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
> index 0b2a2ad1b9e8..15211f74b035 100644
> --- a/arch/arm64/include/asm/pgtable.h
> +++ b/arch/arm64/include/asm/pgtable.h
> @@ -620,11 +620,6 @@ static inline pmd_t pmd_mkspecial(pmd_t pmd)
> #define pud_pfn(pud) ((__pud_to_phys(pud) & PUD_MASK) >> PAGE_SHIFT)
> #define pfn_pud(pfn,prot) __pud(__phys_to_pud_val((phys_addr_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
>
> -#ifdef CONFIG_ARCH_SUPPORTS_PUD_PFNMAP
> -#define pud_special(pte) pte_special(pud_pte(pud))
> -#define pud_mkspecial(pte) pte_pud(pte_mkspecial(pud_pte(pud)))
> -#endif
> -
> #define pmd_pgprot pmd_pgprot
> static inline pgprot_t pmd_pgprot(pmd_t pmd)
> {
LGTM
Reviewed-by: Anshuman Khandual <anshuman.khandual@....com>
Powered by blists - more mailing lists