WSL2-Linux-Kernel/arch/powerpc/mm
Aneesh Kumar K.V 13bd817bb8 powerpc/thp: Serialize pmd clear against a linux page table walk.
Serialize against find_linux_pte_or_hugepte() which does lock-less
lookup in page tables with local interrupts disabled. For huge pages it
casts pmd_t to pte_t. Since the format of pte_t is different from pmd_t
we want to prevent transit from pmd pointing to page table to pmd
pointing to huge page (and back) while interrupts are disabled.  We
clear pmd to possibly replace it with page table pointer in different
code paths. So make sure we wait for the parallel
find_linux_pte_or_hugepage() to finish.

Without this patch, a find_linux_pte_or_hugepte() running in parallel to
__split_huge_zero_page_pmd() or do_huge_pmd_wp_page_fallback() or
zap_huge_pmd() can run into the above issue. With
__split_huge_zero_page_pmd() and do_huge_pmd_wp_page_fallback() we clear
the hugepage pte before inserting the pmd entry with a regular pgtable
address. Such a clear need to wait for the parallel
find_linux_pte_or_hugepte() to finish.

With zap_huge_pmd(), we can run into issues, with a hugepage pte getting
zapped due to a MADV_DONTNEED while other cpu fault it in as small
pages.

Reported-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2015-05-12 11:03:29 +10:00
..
40x_mmu.c memblock: Remove rmo_size, burry it in arch/powerpc where it belongs 2010-08-05 12:56:08 +10:00
44x_mmu.c powerpc: Delete __cpuinit usage from all users 2013-07-01 11:10:36 +10:00
Makefile powerpc/vphn: move VPHN parsing logic to a separate file 2015-03-18 10:48:59 +11:00
copro_fault.c ppc64: add paranoid warnings for unexpected DSISR_PROTFAULT 2015-02-12 18:54:08 -08:00
dma-noncoherent.c powerpc: Fix compile errors with STRICT_MM_TYPECHECKS enabled 2015-04-10 20:02:47 +10:00
fault.c ppc64: add paranoid warnings for unexpected DSISR_PROTFAULT 2015-02-12 18:54:08 -08:00
fsl_booke_mmu.c powerpc: Fix compile errors with STRICT_MM_TYPECHECKS enabled 2015-04-10 20:02:47 +10:00
hash_low_32.S powerpc: Use CURRENT_THREAD_INFO instead of open coded assembly 2012-07-11 14:18:22 +10:00
hash_low_64.S powerpc/mm: don't do tlbie for updatepp request with NO HPTE fault 2014-12-05 16:26:15 +11:00
hash_native_64.c powerpc/mm: don't do tlbie for updatepp request with NO HPTE fault 2014-12-05 16:26:15 +11:00
hash_utils_64.c powerpc/mm: Fix build error with CONFIG_PPC_TRANSACTIONAL_MEM disabled 2015-04-23 17:42:14 +10:00
highmem.c mm: fix race in kunmap_atomic() 2010-10-27 18:03:05 -07:00
hugepage-hash64.c powerpc: Fix compile errors with STRICT_MM_TYPECHECKS enabled 2015-04-10 20:02:47 +10:00
hugetlbpage-book3e.c powerpc: Replace __get_cpu_var uses 2014-11-03 12:12:32 +11:00
hugetlbpage-hash64.c powerpc/mm: don't do tlbie for updatepp request with NO HPTE fault 2014-12-05 16:26:15 +11:00
hugetlbpage.c powerpc/mm/thp: Return pte address if we find trans_splitting. 2015-04-17 11:23:40 +10:00
icswx.c powerpc: Fix typo "CONFIG_ICSWX_PID" 2013-04-18 13:03:54 +10:00
icswx.h powerpc/icswx: Fix race condition with IPI setting ACOP 2012-03-07 17:06:09 +11:00
icswx_pid.c powerpc: Split ICSWX ACOP and PID processing 2011-11-25 14:11:27 +11:00
init_32.c powerpc: Remove superfluous bootmem includes 2014-11-10 09:59:26 +11:00
init_64.c powerpc/mm: Free string after creating kmem cache 2015-03-26 15:23:17 +11:00
mem.c powerpc: Replace mem_init_done with slab_is_available() 2015-04-10 20:02:48 +10:00
mmap.c mm: expose arch_mmap_rnd when available 2015-04-14 16:49:05 -07:00
mmu_context_hash32.c powerpc: Remove power3 from comments 2014-07-28 14:10:26 +10:00
mmu_context_hash64.c powerpc: Reduce PTE table memory wastage 2013-04-30 16:00:07 +10:00
mmu_context_nohash.c powerpc/8xx: reduce pressure on TLB due to context switches 2015-01-29 21:51:06 -06:00
mmu_decl.h powerpc/mm: Change setbat() to take a pgprot_t rather than flags 2015-04-07 17:15:13 +10:00
numa.c powerpc/numa: Reset node_possible_map to only node_online_map 2015-03-23 13:25:53 +11:00
pgtable.c mm: convert p[te|md]_numa users to p[te|md]_protnone_numa 2015-02-12 18:54:08 -08:00
pgtable_32.c powerpc: Replace mem_init_done with slab_is_available() 2015-04-10 20:02:48 +10:00
pgtable_64.c powerpc/thp: Serialize pmd clear against a linux page table walk. 2015-05-12 11:03:29 +10:00
ppc_mmu_32.c powerpc/mm: Change setbat() to take a pgprot_t rather than flags 2015-04-07 17:15:13 +10:00
slb.c powerpc/cell: Move data segment faulting code out of cell platform 2014-10-08 20:14:55 +11:00
slb_low.S Merge remote-tracking branch 'anton/abiv2' into next 2014-05-05 20:57:12 +10:00
slice.c powerpc: Remove some unused functions 2015-01-28 15:00:24 +11:00
subpage-prot.c arch/powerpc/mm/subpage-prot.c: use walk->vma and walk_page_vma() 2015-02-11 17:06:06 -08:00
tlb_hash32.c powerpc: include export.h for files using EXPORT_SYMBOL/THIS_MODULE 2011-10-31 19:30:38 -04:00
tlb_hash64.c powerpc: Fix compile errors with STRICT_MM_TYPECHECKS enabled 2015-04-10 20:02:47 +10:00
tlb_low_64e.S powerpc/e6500: Work around erratum A-008139 2014-07-29 19:26:29 -05:00
tlb_nohash.c powerpc/mm: Warn on flushing tlb page in kernel context 2015-02-04 13:19:27 +11:00
tlb_nohash_low.S powerpc/fsl_booke: smp support for booting a relocatable kernel above 64M 2014-01-09 17:52:18 -06:00
vphn.c powerpc/vphn: parsing code rewrite 2015-03-18 10:48:59 +11:00
vphn.h powerpc/vphn: parsing code rewrite 2015-03-18 10:48:59 +11:00