]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - mm/mprotect.c
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
[karo-tx-linux.git] / mm / mprotect.c
index 8edd0d576254d4c6a3974a42dd2a27eff17fa8bf..bd0f409922cb2fc133f9fecba64a839380d4f937 100644 (file)
@@ -58,14 +58,13 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
         * reading.
         */
        pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
-       if (!pte)
-               return 0;
 
        /* Get target node for single threaded private VMAs */
        if (prot_numa && !(vma->vm_flags & VM_SHARED) &&
            atomic_read(&vma->vm_mm->mm_users) == 1)
                target_node = numa_node_id();
 
+       flush_tlb_batched_pending(vma->vm_mm);
        arch_enter_lazy_mmu_mode();
        do {
                oldpte = *pte;
@@ -245,7 +244,7 @@ static unsigned long change_protection_range(struct vm_area_struct *vma,
        BUG_ON(addr >= end);
        pgd = pgd_offset(mm, addr);
        flush_cache_range(vma, addr, end);
-       set_tlb_flush_pending(mm);
+       inc_tlb_flush_pending(mm);
        do {
                next = pgd_addr_end(addr, end);
                if (pgd_none_or_clear_bad(pgd))
@@ -257,7 +256,7 @@ static unsigned long change_protection_range(struct vm_area_struct *vma,
        /* Only flush the TLB if we actually modified any entries: */
        if (pages)
                flush_tlb_range(vma, start, end);
-       clear_tlb_flush_pending(mm);
+       dec_tlb_flush_pending(mm);
 
        return pages;
 }