The patch titled Subject: mm, vmacache: hash addresses based on pmd fix has been removed from the -mm tree. Its filename was mm-vmacache-hash-addresses-based-on-pmd-fix.patch This patch was dropped because it was folded into mm-vmacache-hash-addresses-based-on-pmd.patch ------------------------------------------------------ From: David Rientjes <rientjes@xxxxxxxxxx> Subject: mm, vmacache: hash addresses based on pmd fix - use PMD_SHIFT only if CONFIG_MMU is used, otherwise there is only pgdir, per kbuild test robot - fix vmacache_find_exact() for correct formal name, per me - only check vma->vm_mm == mm for CONFIG_DEBUG_VM_VMACACHE, per akpm Tested for {allnoconfig, defconfig} on alpha, arc, arm, arm64, c6x, h8300, i386, ia64, m68k, microblaze, mips, mips, nds32, nios2, parisc, powerpc, riscv, s390, sh, sparc, um, and xtensa. Link: http://lkml.kernel.org/r/alpine.DEB.2.21.1807231532290.109445@xxxxxxxxxxxxxxxxxxxxxxxxx Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx> Reported-by: kbuild test robot <lkp@xxxxxxxxx> Cc: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/vmacache.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) --- a/mm/vmacache.c~mm-vmacache-hash-addresses-based-on-pmd-fix +++ a/mm/vmacache.c @@ -6,12 +6,18 @@ #include <linux/sched/task.h> #include <linux/mm.h> #include <linux/vmacache.h> +#include <asm/pgtable.h> /* - * Hash based on the pmd of addr. Provides a good hit rate for workloads with - * spatial locality. + * Hash based on the pmd of addr if configured with MMU, which provides a good + * hit rate for workloads with spatial locality. Otherwise, use pages. */ -#define VMACACHE_HASH(addr) ((addr >> PMD_SHIFT) & VMACACHE_MASK) +#ifdef CONFIG_MMU +#define VMACACHE_SHIFT PMD_SHIFT +#else +#define VMACACHE_SHIFT PAGE_SHIFT +#endif +#define VMACACHE_HASH(addr) ((addr >> VMACACHE_SHIFT) & VMACACHE_MASK) /* * Flush vma caches for threads that share a given mm. @@ -105,8 +111,10 @@ struct vm_area_struct *vmacache_find(str struct vm_area_struct *vma = current->vmacache.vmas[idx]; if (vma) { +#ifdef CONFIG_DEBUG_VM_VMACACHE if (WARN_ON_ONCE(vma->vm_mm != mm)) break; +#endif if (vma->vm_start <= addr && vma->vm_end > addr) { count_vm_vmacache_event(VMACACHE_FIND_HITS); return vma; @@ -124,7 +132,7 @@ struct vm_area_struct *vmacache_find_exa unsigned long start, unsigned long end) { - int idx = VMACACHE_HASH(addr); + int idx = VMACACHE_HASH(start); int i; count_vm_vmacache_event(VMACACHE_FIND_CALLS); _ Patches currently in -mm which might be from rientjes@xxxxxxxxxx are mm-vmacache-hash-addresses-based-on-pmd.patch