Skip to content

Commit a8a93f3

Browse files
author
Jeremy Fitzhardinge
committed
mm: disable preemption in apply_to_pte_range
Impact: bugfix Lazy mmu mode needs preemption disabled, so if we're apply to init_mm (which doesn't require any pte locks), then explicitly disable preemption. (Do it unconditionally after checking we've successfully done the allocation to simplify the error handling.) Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
1 parent 0d34fb8 commit a8a93f3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎mm/memory.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,6 +1718,7 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,
17181718

17191719
BUG_ON(pmd_huge(*pmd));
17201720

1721+
preempt_disable();
17211722
arch_enter_lazy_mmu_mode();
17221723

17231724
token = pmd_pgtable(*pmd);
@@ -1729,6 +1730,7 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,
17291730
} while (pte++, addr += PAGE_SIZE, addr != end);
17301731

17311732
arch_leave_lazy_mmu_mode();
1733+
preempt_enable();
17321734

17331735
if (mm != &init_mm)
17341736
pte_unmap_unlock(pte-1, ptl);

0 commit comments

Comments
 (0)