diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 2bde07dd5258..092bc7ae184e 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1345,8 +1345,6 @@ void collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr) if (!pmd) goto drop_hpage; - vm_write_begin(vma); - /* * We need to lock the mapping so that from here on, only GUP-fast and * hardware page walks can access the parts of the page tables that @@ -1414,7 +1412,6 @@ void collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr) haddr + HPAGE_PMD_SIZE); mmu_notifier_invalidate_range_start(&range); _pmd = pmdp_collapse_flush(vma, haddr, pmd); - vm_write_end(vma); mm_dec_nr_ptes(mm); tlb_remove_table_sync_one(); mmu_notifier_invalidate_range_end(&range); @@ -1431,7 +1428,6 @@ drop_hpage: abort: pte_unmap_unlock(start_pte, ptl); - vm_write_end(vma); i_mmap_unlock_write(vma->vm_file->f_mapping); goto drop_hpage; } @@ -1512,10 +1508,8 @@ static void retract_page_tables(struct address_space *mapping, pgoff_t pgoff) NULL, mm, addr, addr + HPAGE_PMD_SIZE); mmu_notifier_invalidate_range_start(&range); - vm_write_begin(vma); /* assume page table is clear */ _pmd = pmdp_collapse_flush(vma, addr, pmd); - vm_write_end(vma); mm_dec_nr_ptes(mm); tlb_remove_table_sync_one(); pte_free(mm, pmd_pgtable(_pmd));