OSDN Git Service

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
[uclinux-h8/linux.git] / mm / huge_memory.c
index 5b2c687..46f96c2 100644 (file)
@@ -804,7 +804,7 @@ int do_huge_pmd_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
                return VM_FAULT_OOM;
        if (unlikely(khugepaged_enter(vma, vma->vm_flags)))
                return VM_FAULT_OOM;
-       if (!(flags & FAULT_FLAG_WRITE) &&
+       if (!(flags & FAULT_FLAG_WRITE) && !mm_forbids_zeropage(mm) &&
                        transparent_hugepage_use_zero_page()) {
                spinlock_t *ptl;
                pgtable_t pgtable;
@@ -1399,7 +1399,8 @@ int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
                 * pgtable_trans_huge_withdraw after finishing pmdp related
                 * operations.
                 */
-               orig_pmd = pmdp_get_and_clear(tlb->mm, addr, pmd);
+               orig_pmd = pmdp_get_and_clear_full(tlb->mm, addr, pmd,
+                                                  tlb->fullmm);
                tlb_remove_pmd_tlb_entry(tlb, pmd, addr);
                pgtable = pgtable_trans_huge_withdraw(tlb->mm, pmd);
                if (is_huge_zero_pmd(orig_pmd)) {