aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/huge_memory.c5
-rw-r--r--mm/memory.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 5b2c6875fc38..46f96c23cc27 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -804,7 +804,7 @@ int do_huge_pmd_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
804 return VM_FAULT_OOM; 804 return VM_FAULT_OOM;
805 if (unlikely(khugepaged_enter(vma, vma->vm_flags))) 805 if (unlikely(khugepaged_enter(vma, vma->vm_flags)))
806 return VM_FAULT_OOM; 806 return VM_FAULT_OOM;
807 if (!(flags & FAULT_FLAG_WRITE) && 807 if (!(flags & FAULT_FLAG_WRITE) && !mm_forbids_zeropage(mm) &&
808 transparent_hugepage_use_zero_page()) { 808 transparent_hugepage_use_zero_page()) {
809 spinlock_t *ptl; 809 spinlock_t *ptl;
810 pgtable_t pgtable; 810 pgtable_t pgtable;
@@ -1399,7 +1399,8 @@ int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
1399 * pgtable_trans_huge_withdraw after finishing pmdp related 1399 * pgtable_trans_huge_withdraw after finishing pmdp related
1400 * operations. 1400 * operations.
1401 */ 1401 */
1402 orig_pmd = pmdp_get_and_clear(tlb->mm, addr, pmd); 1402 orig_pmd = pmdp_get_and_clear_full(tlb->mm, addr, pmd,
1403 tlb->fullmm);
1403 tlb_remove_pmd_tlb_entry(tlb, pmd, addr); 1404 tlb_remove_pmd_tlb_entry(tlb, pmd, addr);
1404 pgtable = pgtable_trans_huge_withdraw(tlb->mm, pmd); 1405 pgtable = pgtable_trans_huge_withdraw(tlb->mm, pmd);
1405 if (is_huge_zero_pmd(orig_pmd)) { 1406 if (is_huge_zero_pmd(orig_pmd)) {
diff --git a/mm/memory.c b/mm/memory.c
index 0b3f6c71620d..4b5a282e1107 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2627,7 +2627,7 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
2627 return VM_FAULT_SIGBUS; 2627 return VM_FAULT_SIGBUS;
2628 2628
2629 /* Use the zero-page for reads */ 2629 /* Use the zero-page for reads */
2630 if (!(flags & FAULT_FLAG_WRITE)) { 2630 if (!(flags & FAULT_FLAG_WRITE) && !mm_forbids_zeropage(mm)) {
2631 entry = pte_mkspecial(pfn_pte(my_zero_pfn(address), 2631 entry = pte_mkspecial(pfn_pte(my_zero_pfn(address),
2632 vma->vm_page_prot)); 2632 vma->vm_page_prot));
2633 page_table = pte_offset_map_lock(mm, pmd, address, &ptl); 2633 page_table = pte_offset_map_lock(mm, pmd, address, &ptl);