The patch titled Subject: thp: zap_huge_pmd(): zap huge zero pmd has been added to the -mm tree. Its filename is thp-zap_huge_pmd-zap-huge-zero-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: "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx> Subject: thp: zap_huge_pmd(): zap huge zero pmd We don't have a real page to zap in huge zero page case. Let's just clear pmd and remove it from tlb. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx> Cc: "H. Peter Anvin" <hpa@xxxxxxxxxxxxxxx> Cc: Mel Gorman <mel@xxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/huge_memory.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff -puN mm/huge_memory.c~thp-zap_huge_pmd-zap-huge-zero-pmd mm/huge_memory.c --- a/mm/huge_memory.c~thp-zap_huge_pmd-zap-huge-zero-pmd +++ a/mm/huge_memory.c @@ -1233,15 +1233,20 @@ int zap_huge_pmd(struct mmu_gather *tlb, pmd_t orig_pmd; pgtable = pgtable_trans_huge_withdraw(tlb->mm); 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); - add_mm_counter(tlb->mm, MM_ANONPAGES, -HPAGE_PMD_NR); - VM_BUG_ON(!PageHead(page)); - tlb->mm->nr_ptes--; - spin_unlock(&tlb->mm->page_table_lock); - tlb_remove_page(tlb, page); + if (is_huge_zero_pmd(orig_pmd)) { + tlb->mm->nr_ptes--; + spin_unlock(&tlb->mm->page_table_lock); + } else { + page = pmd_page(orig_pmd); + page_remove_rmap(page); + VM_BUG_ON(page_mapcount(page) < 0); + add_mm_counter(tlb->mm, MM_ANONPAGES, -HPAGE_PMD_NR); + VM_BUG_ON(!PageHead(page)); + tlb->mm->nr_ptes--; + spin_unlock(&tlb->mm->page_table_lock); + tlb_remove_page(tlb, page); + } pte_free(tlb->mm, pgtable); ret = 1; } _ Patches currently in -mm which might be from kirill.shutemov@xxxxxxxxxxxxxxx are linux-next.patch mm-use-is_enabledconfig_numa-instead-of-numa_build.patch mm-use-is_enabledconfig_compaction-instead-of-compaction_build.patch thp-huge-zero-page-basic-preparation.patch thp-zap_huge_pmd-zap-huge-zero-pmd.patch thp-copy_huge_pmd-copy-huge-zero-page.patch thp-do_huge_pmd_wp_page-handle-huge-zero-page.patch thp-change_huge_pmd-keep-huge-zero-page-write-protected.patch thp-change-split_huge_page_pmd-interface.patch thp-implement-splitting-pmd-for-huge-zero-page.patch thp-setup-huge-zero-page-on-non-write-page-fault.patch thp-lazy-huge-zero-page-allocation.patch thp-implement-refcounting-for-huge-zero-page.patch thp-vmstat-implement-hzp_alloc-and-hzp_alloc_failed-events.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