aboutsummaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r--mm/hugetlb.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 2d2ff5e8bf2b..681b300185c0 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -3256,9 +3256,14 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
3256 set_huge_swap_pte_at(dst, addr, dst_pte, entry, sz); 3256 set_huge_swap_pte_at(dst, addr, dst_pte, entry, sz);
3257 } else { 3257 } else {
3258 if (cow) { 3258 if (cow) {
3259 /*
3260 * No need to notify as we are downgrading page
3261 * table protection not changing it to point
3262 * to a new page.
3263 *
3264 * See Documentation/vm/mmu_notifier.txt
3265 */
3259 huge_ptep_set_wrprotect(src, addr, src_pte); 3266 huge_ptep_set_wrprotect(src, addr, src_pte);
3260 mmu_notifier_invalidate_range(src, mmun_start,
3261 mmun_end);
3262 } 3267 }
3263 entry = huge_ptep_get(src_pte); 3268 entry = huge_ptep_get(src_pte);
3264 ptepage = pte_page(entry); 3269 ptepage = pte_page(entry);
@@ -4318,7 +4323,12 @@ unsigned long hugetlb_change_protection(struct vm_area_struct *vma,
4318 * and that page table be reused and filled with junk. 4323 * and that page table be reused and filled with junk.
4319 */ 4324 */
4320 flush_hugetlb_tlb_range(vma, start, end); 4325 flush_hugetlb_tlb_range(vma, start, end);
4321 mmu_notifier_invalidate_range(mm, start, end); 4326 /*
4327 * No need to call mmu_notifier_invalidate_range() we are downgrading
4328 * page table protection not changing it to point to a new page.
4329 *
4330 * See Documentation/vm/mmu_notifier.txt
4331 */
4322 i_mmap_unlock_write(vma->vm_file->f_mapping); 4332 i_mmap_unlock_write(vma->vm_file->f_mapping);
4323 mmu_notifier_invalidate_range_end(mm, start, end); 4333 mmu_notifier_invalidate_range_end(mm, start, end);
4324 4334