The patch titled Subject: mm: rmap: use correct helper when poisoning hugepages has been added to the -mm tree. Its filename is mm-rmap-use-correct-helper-when-poisoning-hugepages.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-rmap-use-correct-helper-when-poisoning-hugepages.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-rmap-use-correct-helper-when-poisoning-hugepages.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: Punit Agrawal <punit.agrawal@xxxxxxx> Subject: mm: rmap: use correct helper when poisoning hugepages Using set_pte_at() does not do the right thing when putting down HWPOISON swap entries for hugepages on architectures that support contiguous ptes. Fix this problem by using set_huge_swap_pte_at() which was introduced to fix exactly this problem. Link: http://lkml.kernel.org/r/20170522133604.11392-7-punit.agrawal@xxxxxxx Signed-off-by: Punit Agrawal <punit.agrawal@xxxxxxx> Acked-by: Steve Capper <steve.capper@xxxxxxx> Cc: "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx> Cc: Catalin Marinas <catalin.marinas@xxxxxxx> Cc: Will Deacon <will.deacon@xxxxxxx> Cc: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx> Cc: Mike Kravetz <mike.kravetz@xxxxxxxxxx> Cc: Mark Rutland <mark.rutland@xxxxxxx> Cc: Hillf Danton <hillf.zj@xxxxxxxxxxxxxxx> Cc: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: Mike Kravetz <mike.kravetz@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/rmap.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff -puN mm/rmap.c~mm-rmap-use-correct-helper-when-poisoning-hugepages mm/rmap.c --- a/mm/rmap.c~mm-rmap-use-correct-helper-when-poisoning-hugepages +++ a/mm/rmap.c @@ -1379,15 +1379,18 @@ static bool try_to_unmap_one(struct page update_hiwater_rss(mm); if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) { + pteval = swp_entry_to_pte(make_hwpoison_entry(subpage)); if (PageHuge(page)) { int nr = 1 << compound_order(page); hugetlb_count_sub(nr, mm); + set_huge_swap_pte_at(mm, address, + pvmw.pte, pteval, + vma_mmu_pagesize(vma)); } else { dec_mm_counter(mm, mm_counter(page)); + set_pte_at(mm, address, pvmw.pte, pteval); } - pteval = swp_entry_to_pte(make_hwpoison_entry(subpage)); - set_pte_at(mm, address, pvmw.pte, pteval); } else if (pte_unused(pteval)) { /* * The guest indicated that the page content is of no _ Patches currently in -mm which might be from punit.agrawal@xxxxxxx are mm-gup-ensure-real-head-page-is-ref-counted-when-using-hugepages.patch mm-hugetlb-add-size-parameter-to-huge_pte_offset.patch mm-hugetlb-allow-architectures-to-override-huge_pte_clear.patch mm-hugetlb-introduce-set_huge_swap_pte_at-helper.patch mm-rmap-use-correct-helper-when-poisoning-hugepages.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