The patch titled Subject: mm-thp-calculate-the-mapcount-correctly-for-thp-pages-during-wp-faults-fix-2 has been added to the -mm tree. Its filename is mm-thp-calculate-the-mapcount-correctly-for-thp-pages-during-wp-faults-fix-2.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-thp-calculate-the-mapcount-correctly-for-thp-pages-during-wp-faults-fix-2.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-thp-calculate-the-mapcount-correctly-for-thp-pages-during-wp-faults-fix-2.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: Andrea Arcangeli <aarcange@xxxxxxxxxx> Subject: mm-thp-calculate-the-mapcount-correctly-for-thp-pages-during-wp-faults-fix-2 Link: http://lkml.kernel.org/r/1463070742-18401-1-git-send-email-aarcange@xxxxxxxxxx Signed-off-by: Andrea Arcangeli <aarcange@xxxxxxxxxx> Reviewed-by: "Kirill A. Shutemov" <kirill@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/huge_memory.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff -puN mm/huge_memory.c~mm-thp-calculate-the-mapcount-correctly-for-thp-pages-during-wp-faults-fix-2 mm/huge_memory.c --- a/mm/huge_memory.c~mm-thp-calculate-the-mapcount-correctly-for-thp-pages-during-wp-faults-fix-2 +++ a/mm/huge_memory.c @@ -3248,8 +3248,12 @@ int page_trans_huge_mapcount(struct page /* hugetlbfs shouldn't call it */ VM_BUG_ON_PAGE(PageHuge(page), page); - if (likely(!PageTransCompound(page))) - return atomic_read(&page->_mapcount) + 1; + if (likely(!PageTransCompound(page))) { + mapcount = atomic_read(&page->_mapcount) + 1; + if (total_mapcount) + *total_mapcount = mapcount; + return mapcount; + } page = compound_head(page); _ Patches currently in -mm which might be from aarcange@xxxxxxxxxx are mm-thp-calculate-the-mapcount-correctly-for-thp-pages-during-wp-faults.patch mm-thp-calculate-the-mapcount-correctly-for-thp-pages-during-wp-faults-fix.patch mm-thp-calculate-the-mapcount-correctly-for-thp-pages-during-wp-faults-fix-2.patch mm-thp-microoptimize-compound_mapcount.patch mm-thp-split_huge_pmd_address-comment-improvement.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