powerpc/64s/radix: Don't prefetch DAR in update_mmu_cache
authorNicholas Piggin <npiggin@gmail.com>
Mon, 4 May 2020 12:29:07 +0000 (22:29 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 28 May 2020 13:24:34 +0000 (23:24 +1000)
The idea behind this prefetch was to kick off a page table walk before
returning from the fault, getting some pipelining advantage.

But this never showed up any noticable performance advantage, and in
fact with KUAP the prefetches are actually blocked and cause some
kind of micro-architectural fault. Removing this improves page fault
microbenchmark performance by about 9%.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Keep the early return in update_mmu_cache()]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200504122907.49304-1-npiggin@gmail.com
arch/powerpc/include/asm/book3s/64/pgtable.h
arch/powerpc/mm/book3s64/hash_utils.c
arch/powerpc/mm/book3s64/pgtable.c

index ec17fc343be01cb31c781bf10bba931577157e51..c4b77fa0b9ad38507e512ffcda16639cc04a4de6 100644 (file)
@@ -1159,8 +1159,11 @@ extern pmd_t mk_pmd(struct page *page, pgprot_t pgprot);
 extern pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot);
 extern void set_pmd_at(struct mm_struct *mm, unsigned long addr,
                       pmd_t *pmdp, pmd_t pmd);
-extern void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr,
-                                pmd_t *pmd);
+static inline void update_mmu_cache_pmd(struct vm_area_struct *vma,
+                                       unsigned long addr, pmd_t *pmd)
+{
+}
+
 extern int hash__has_transparent_hugepage(void);
 static inline int has_transparent_hugepage(void)
 {
index 622c6e8e9fa683095e5ba7a5bba7f89bef0240f8..0124003e60d0a485a39db9881d1013b40a1e0063 100644 (file)
@@ -1634,10 +1634,8 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
        unsigned long trap;
        bool is_exec;
 
-       if (radix_enabled()) {
-               prefetch((void *)address);
+       if (radix_enabled())
                return;
-       }
 
        /* We only want HPTEs for linux PTEs that have _PAGE_ACCESSED set */
        if (!pte_young(*ptep) || address >= TASK_SIZE)
index 54b6d6d103eadc747084ef22ecb66cddcfb6b944..c58ad1049909ef24ac128e11dd9233c3813b8159 100644 (file)
@@ -156,19 +156,6 @@ pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
        pmdv &= _HPAGE_CHG_MASK;
        return pmd_set_protbits(__pmd(pmdv), newprot);
 }
-
-/*
- * This is called at the end of handling a user page fault, when the
- * fault has been handled by updating a HUGE PMD entry in the linux page tables.
- * We use it to preload an HPTE into the hash table corresponding to
- * the updated linux HUGE PMD entry.
- */
-void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr,
-                         pmd_t *pmd)
-{
-       if (radix_enabled())
-               prefetch((void *)addr);
-}
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 
 /* For use by kexec */