]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - mm/hugetlb.c
Merge tag 'linux-cpupower-4.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel...
[linux.git] / mm / hugetlb.c
index 2d2ff5e8bf2bc035eb300ee16dbdaadcdb0279dd..681b300185c0c0383bb240d6a898849bf777f46b 100644 (file)
@@ -3256,9 +3256,14 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
                        set_huge_swap_pte_at(dst, addr, dst_pte, entry, sz);
                } else {
                        if (cow) {
+                               /*
+                                * No need to notify as we are downgrading page
+                                * table protection not changing it to point
+                                * to a new page.
+                                *
+                                * See Documentation/vm/mmu_notifier.txt
+                                */
                                huge_ptep_set_wrprotect(src, addr, src_pte);
-                               mmu_notifier_invalidate_range(src, mmun_start,
-                                                                  mmun_end);
                        }
                        entry = huge_ptep_get(src_pte);
                        ptepage = pte_page(entry);
@@ -4318,7 +4323,12 @@ unsigned long hugetlb_change_protection(struct vm_area_struct *vma,
         * and that page table be reused and filled with junk.
         */
        flush_hugetlb_tlb_range(vma, start, end);
-       mmu_notifier_invalidate_range(mm, start, end);
+       /*
+        * No need to call mmu_notifier_invalidate_range() we are downgrading
+        * page table protection not changing it to point to a new page.
+        *
+        * See Documentation/vm/mmu_notifier.txt
+        */
        i_mmap_unlock_write(vma->vm_file->f_mapping);
        mmu_notifier_invalidate_range_end(mm, start, end);