mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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/[email protected] Signed-off-by: Punit Agrawal <[email protected]> Acked-by: Steve Capper <[email protected]> Cc: "Kirill A. Shutemov" <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Cc: Naoya Horiguchi <[email protected]> Cc: Mike Kravetz <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Hillf Danton <[email protected]> Cc: Aneesh Kumar K.V <[email protected]> Cc: Michal Hocko <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
e5251fd430
commit
5fd27b8e7d
1 changed files with 5 additions and 2 deletions
|
|
@ -1367,15 +1367,18 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
|
|||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue