Skip to content

Commit 38e0edb

Browse files
jsgftorvalds
authored andcommitted
mm/apply_to_range: call pte function with lazy updates
Make the pte-level function in apply_to_range be called in lazy mmu mode, so that any pagetable modifications can be batched. Signed-off-by: Jeremy Fitzhardinge <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Nick Piggin <[email protected]> Cc: Venkatesh Pallipadi <[email protected]> Cc: Hugh Dickins <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent cd52858 commit 38e0edb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mm/memory.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,6 +1645,8 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,
16451645

16461646
BUG_ON(pmd_huge(*pmd));
16471647

1648+
arch_enter_lazy_mmu_mode();
1649+
16481650
token = pmd_pgtable(*pmd);
16491651

16501652
do {
@@ -1653,6 +1655,8 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,
16531655
break;
16541656
} while (pte++, addr += PAGE_SIZE, addr != end);
16551657

1658+
arch_leave_lazy_mmu_mode();
1659+
16561660
if (mm != &init_mm)
16571661
pte_unmap_unlock(pte-1, ptl);
16581662
return err;

0 commit comments

Comments
 (0)