aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-02-12 16:45:34 -0500
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-03-30 02:29:15 -0400
commita8a93f3f03b7a8008d720e8d91798efe599d416c (patch)
tree7238d910d74a8df91280a47bab57707beb4fa101
parent0d34fb8e93ceba7b6dad0062dbb4a0813bacd75b (diff)
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>
-rw-r--r--mm/memory.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c
index baa999e87cd2..b80cc31292b1 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1718,6 +1718,7 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,
1718 1718
1719 BUG_ON(pmd_huge(*pmd)); 1719 BUG_ON(pmd_huge(*pmd));
1720 1720
1721 preempt_disable();
1721 arch_enter_lazy_mmu_mode(); 1722 arch_enter_lazy_mmu_mode();
1722 1723
1723 token = pmd_pgtable(*pmd); 1724 token = pmd_pgtable(*pmd);
@@ -1729,6 +1730,7 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,
1729 } while (pte++, addr += PAGE_SIZE, addr != end); 1730 } while (pte++, addr += PAGE_SIZE, addr != end);
1730 1731
1731 arch_leave_lazy_mmu_mode(); 1732 arch_leave_lazy_mmu_mode();
1733 preempt_enable();
1732 1734
1733 if (mm != &init_mm) 1735 if (mm != &init_mm)
1734 pte_unmap_unlock(pte-1, ptl); 1736 pte_unmap_unlock(pte-1, ptl);