]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - mm/mprotect.c
Merge tag 'y2038-alsa-v8-signed' of git://git.kernel.org:/pub/scm/linux/kernel/git...
[linux.git] / mm / mprotect.c
index 7967825f6d3352b3b57ccd23018d461d41498b78..7a8e84f86831b4e4f2a8cdf535bf48fb9990979e 100644 (file)
@@ -80,6 +80,10 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
                        if (prot_numa) {
                                struct page *page;
 
+                               /* Avoid TLB flush if possible */
+                               if (pte_protnone(oldpte))
+                                       continue;
+
                                page = vm_normal_page(vma, addr, oldpte);
                                if (!page || PageKsm(page))
                                        continue;
@@ -97,10 +101,6 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
                                if (page_is_file_cache(page) && PageDirty(page))
                                        continue;
 
-                               /* Avoid TLB flush if possible */
-                               if (pte_protnone(oldpte))
-                                       continue;
-
                                /*
                                 * Don't mess with PTEs if page is already on the node
                                 * a single-threaded process is running on.