mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-10-31 18:09:19 +00:00
thp: zap_huge_pmd(): zap huge zero pmd
We don't have a mapped 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@linux.intel.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: "H. Peter Anvin" <hpa@linux.intel.com> Cc: Mel Gorman <mel@csn.ul.ie> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
4a6c129726
commit
479f0abbfd
1 changed files with 13 additions and 8 deletions
|
@ -1085,15 +1085,20 @@ int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue