Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm/arm: remove pmd_thp_or_huge()

ARM/ARM64 used to define pmd_thp_or_huge(). Now this macro is completely
redundant. Remove it and use pmd_leaf().

Link: https://lkml.kernel.org/r/20240318200404.448346-14-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Bjorn Andersson <andersson@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Mike Rapoport (IBM) <rppt@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Cc: "Naveen N. Rao" <naveen.n.rao@linux.ibm.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Peter Xu and committed by
Andrew Morton
502016e3 9636f055

+2 -6
-1
arch/arm/include/asm/pgtable-2level.h
··· 241 241 * define empty stubs for use by pin_page_for_write. 242 242 */ 243 243 #define pmd_hugewillfault(pmd) (0) 244 - #define pmd_thp_or_huge(pmd) (0) 245 244 246 245 #endif /* __ASSEMBLY__ */ 247 246
-1
arch/arm/include/asm/pgtable-3level.h
··· 190 190 #define pmd_dirty(pmd) (pmd_isset((pmd), L_PMD_SECT_DIRTY)) 191 191 192 192 #define pmd_hugewillfault(pmd) (!pmd_young(pmd) || !pmd_write(pmd)) 193 - #define pmd_thp_or_huge(pmd) (pmd_leaf(pmd) || pmd_trans_huge(pmd)) 194 193 195 194 #ifdef CONFIG_TRANSPARENT_HUGEPAGE 196 195 #define pmd_trans_huge(pmd) (pmd_val(pmd) && !pmd_table(pmd))
+2 -2
arch/arm/lib/uaccess_with_memcpy.c
··· 56 56 * to see that it's still huge and whether or not we will 57 57 * need to fault on write. 58 58 */ 59 - if (unlikely(pmd_thp_or_huge(*pmd))) { 59 + if (unlikely(pmd_leaf(*pmd))) { 60 60 ptl = &current->mm->page_table_lock; 61 61 spin_lock(ptl); 62 - if (unlikely(!pmd_thp_or_huge(*pmd) 62 + if (unlikely(!pmd_leaf(*pmd) 63 63 || pmd_hugewillfault(*pmd))) { 64 64 spin_unlock(ptl); 65 65 return 0;
-2
arch/arm64/include/asm/pgtable.h
··· 517 517 return pmd; 518 518 } 519 519 520 - #define pmd_thp_or_huge(pmd) (pmd_leaf(pmd) || pmd_trans_huge(pmd)) 521 - 522 520 #define pmd_write(pmd) pte_write(pmd_pte(pmd)) 523 521 524 522 #define pmd_mkhuge(pmd) (__pmd(pmd_val(pmd) & ~PMD_TABLE_BIT))