]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mm/arm: remove pmd_thp_or_huge()
authorPeter Xu <peterx@redhat.com>
Mon, 18 Mar 2024 20:04:03 +0000 (16:04 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 26 Apr 2024 03:55:47 +0000 (20:55 -0700)
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>
arch/arm/include/asm/pgtable-2level.h
arch/arm/include/asm/pgtable-3level.h
arch/arm/lib/uaccess_with_memcpy.c
arch/arm64/include/asm/pgtable.h

index 4245c2e7472032ecff6ff1239ad4974e1a8562fc..6b5392e20f41134866ed0752ffb95c0991bb2b56 100644 (file)
@@ -241,7 +241,6 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
  * define empty stubs for use by pin_page_for_write.
  */
 #define pmd_hugewillfault(pmd) (0)
-#define pmd_thp_or_huge(pmd)   (0)
 
 #endif /* __ASSEMBLY__ */
 
index 9e3c44f0aea229192b471620e23b2a5b022836f3..fa5939eb9864ef2d487d6df5f1938c6034c7ae7b 100644 (file)
@@ -190,7 +190,6 @@ static inline pte_t pte_mkspecial(pte_t pte)
 #define pmd_dirty(pmd)         (pmd_isset((pmd), L_PMD_SECT_DIRTY))
 
 #define pmd_hugewillfault(pmd) (!pmd_young(pmd) || !pmd_write(pmd))
-#define pmd_thp_or_huge(pmd)   (pmd_leaf(pmd) || pmd_trans_huge(pmd))
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 #define pmd_trans_huge(pmd)    (pmd_val(pmd) && !pmd_table(pmd))
index 2f6163f05e9357398a5d718be0a31e0ea132e0d2..c0ac7796d775081e1871fef3b340edc906ced161 100644 (file)
@@ -56,10 +56,10 @@ pin_page_for_write(const void __user *_addr, pte_t **ptep, spinlock_t **ptlp)
         * to see that it's still huge and whether or not we will
         * need to fault on write.
         */
-       if (unlikely(pmd_thp_or_huge(*pmd))) {
+       if (unlikely(pmd_leaf(*pmd))) {
                ptl = &current->mm->page_table_lock;
                spin_lock(ptl);
-               if (unlikely(!pmd_thp_or_huge(*pmd)
+               if (unlikely(!pmd_leaf(*pmd)
                        || pmd_hugewillfault(*pmd))) {
                        spin_unlock(ptl);
                        return 0;
index a5c84f38c52833aafe9436344401c563111e864d..6870b60158fc8bd2810b88291f22964b6e8e19ec 100644 (file)
@@ -517,8 +517,6 @@ static inline pmd_t pmd_mkinvalid(pmd_t pmd)
        return pmd;
 }
 
-#define pmd_thp_or_huge(pmd)   (pmd_leaf(pmd) || pmd_trans_huge(pmd))
-
 #define pmd_write(pmd)         pte_write(pmd_pte(pmd))
 
 #define pmd_mkhuge(pmd)                (__pmd(pmd_val(pmd) & ~PMD_TABLE_BIT))