The patch titled Subject: mm: thp: Use more portable PMD clearing sequenece in zap_huge_pmd(). has been added to the -mm tree. Its filename is mm-thp-use-more-portable-pmd-clearing-sequenece-in-zap_huge_pmd.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: David Miller <davem@xxxxxxxxxxxxx> Subject: mm: thp: Use more portable PMD clearing sequenece in zap_huge_pmd(). Invalidation sequences are handled in various ways on various architectures. One way, which sparc64 uses, is to let the set_*_at() functions accumulate pending flushes into a per-cpu array. Then the flush_tlb_range() et al. calls process the pending TLB flushes. In this regime, the __tlb_remove_*tlb_entry() implementations are essentially NOPs. The canonical PTE zap in mm/memory.c is: ptent = ptep_get_and_clear_full(mm, addr, pte, tlb->fullmm); tlb_remove_tlb_entry(tlb, pte, addr); With a subsequent tlb_flush_mmu() if needed. Mirror this in the THP PMD zapping using: orig_pmd = pmdp_get_and_clear(tlb->mm, addr, pmd); page = pmd_page(orig_pmd); tlb_remove_pmd_tlb_entry(tlb, pmd, addr); And we properly accomodate TLB flush mechanims like the one described above. Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Gerald Schaefer <gerald.schaefer@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/huge_memory.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff -puN mm/huge_memory.c~mm-thp-use-more-portable-pmd-clearing-sequenece-in-zap_huge_pmd mm/huge_memory.c --- a/mm/huge_memory.c~mm-thp-use-more-portable-pmd-clearing-sequenece-in-zap_huge_pmd +++ a/mm/huge_memory.c @@ -1093,9 +1093,10 @@ int zap_huge_pmd(struct mmu_gather *tlb, if (__pmd_trans_huge_lock(pmd, vma) == 1) { struct page *page; pgtable_t pgtable; + pmd_t orig_pmd; pgtable = pgtable_trans_huge_withdraw(tlb->mm); - page = pmd_page(*pmd); - pmd_clear(pmd); + orig_pmd = pmdp_get_and_clear(tlb->mm, addr, pmd); + page = pmd_page(orig_pmd); tlb_remove_pmd_tlb_entry(tlb, pmd, addr); page_remove_rmap(page); VM_BUG_ON(page_mapcount(page) < 0); _ Patches currently in -mm which might be from davem@xxxxxxxxxxxxx are origin.patch linux-next.patch kconfig-clean-up-the-long-arch-list-for-the-uid16-config-option.patch kconfig-clean-up-the-long-arch-list-for-the-debug_kmemleak-config-option.patch kconfig-clean-up-the-long-arch-list-for-the-debug_bugverbose-config-option.patch kconfig-clean-up-the-if-definedarch-list-for-exception-trace-sysctl-entry.patch atomic-implement-generic-atomic_dec_if_positive.patch atomic-implement-generic-atomic_dec_if_positive-fix.patch sparc64-only-support-4mb-huge-pages-and-8kb-base-pages.patch sparc64-halve-the-size-of-pte-tables.patch sparc64-eliminate-pte-table-memory-wastage.patch sparc64-document-pgd-and-pmd-layout.patch mm-add-and-use-update_mmu_cache_pmd-in-transparent-huge-page-code.patch mm-add-and-use-update_mmu_cache_pmd-in-transparent-huge-page-code-fix.patch mm-thp-use-more-portable-pmd-clearing-sequenece-in-zap_huge_pmd.patch sparc64-support-transparent-huge-pages.patch compat-generic-compat_sys_sched_rr_get_interval-implementation.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html