diff options
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c index 2e754621d333..9cf3f341a28a 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -506,6 +506,7 @@ again: | |||
506 | src_pte = pte_offset_map_nested(src_pmd, addr); | 506 | src_pte = pte_offset_map_nested(src_pmd, addr); |
507 | src_ptl = pte_lockptr(src_mm, src_pmd); | 507 | src_ptl = pte_lockptr(src_mm, src_pmd); |
508 | spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING); | 508 | spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING); |
509 | arch_enter_lazy_mmu_mode(); | ||
509 | 510 | ||
510 | do { | 511 | do { |
511 | /* | 512 | /* |
@@ -527,6 +528,7 @@ again: | |||
527 | progress += 8; | 528 | progress += 8; |
528 | } while (dst_pte++, src_pte++, addr += PAGE_SIZE, addr != end); | 529 | } while (dst_pte++, src_pte++, addr += PAGE_SIZE, addr != end); |
529 | 530 | ||
531 | arch_leave_lazy_mmu_mode(); | ||
530 | spin_unlock(src_ptl); | 532 | spin_unlock(src_ptl); |
531 | pte_unmap_nested(src_pte - 1); | 533 | pte_unmap_nested(src_pte - 1); |
532 | add_mm_rss(dst_mm, rss[0], rss[1]); | 534 | add_mm_rss(dst_mm, rss[0], rss[1]); |
@@ -628,6 +630,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb, | |||
628 | int anon_rss = 0; | 630 | int anon_rss = 0; |
629 | 631 | ||
630 | pte = pte_offset_map_lock(mm, pmd, addr, &ptl); | 632 | pte = pte_offset_map_lock(mm, pmd, addr, &ptl); |
633 | arch_enter_lazy_mmu_mode(); | ||
631 | do { | 634 | do { |
632 | pte_t ptent = *pte; | 635 | pte_t ptent = *pte; |
633 | if (pte_none(ptent)) { | 636 | if (pte_none(ptent)) { |
@@ -694,6 +697,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb, | |||
694 | } while (pte++, addr += PAGE_SIZE, (addr != end && *zap_work > 0)); | 697 | } while (pte++, addr += PAGE_SIZE, (addr != end && *zap_work > 0)); |
695 | 698 | ||
696 | add_mm_rss(mm, file_rss, anon_rss); | 699 | add_mm_rss(mm, file_rss, anon_rss); |
700 | arch_leave_lazy_mmu_mode(); | ||
697 | pte_unmap_unlock(pte - 1, ptl); | 701 | pte_unmap_unlock(pte - 1, ptl); |
698 | 702 | ||
699 | return addr; | 703 | return addr; |
@@ -1109,6 +1113,7 @@ static int zeromap_pte_range(struct mm_struct *mm, pmd_t *pmd, | |||
1109 | pte = pte_alloc_map_lock(mm, pmd, addr, &ptl); | 1113 | pte = pte_alloc_map_lock(mm, pmd, addr, &ptl); |
1110 | if (!pte) | 1114 | if (!pte) |
1111 | return -ENOMEM; | 1115 | return -ENOMEM; |
1116 | arch_enter_lazy_mmu_mode(); | ||
1112 | do { | 1117 | do { |
1113 | struct page *page = ZERO_PAGE(addr); | 1118 | struct page *page = ZERO_PAGE(addr); |
1114 | pte_t zero_pte = pte_wrprotect(mk_pte(page, prot)); | 1119 | pte_t zero_pte = pte_wrprotect(mk_pte(page, prot)); |
@@ -1118,6 +1123,7 @@ static int zeromap_pte_range(struct mm_struct *mm, pmd_t *pmd, | |||
1118 | BUG_ON(!pte_none(*pte)); | 1123 | BUG_ON(!pte_none(*pte)); |
1119 | set_pte_at(mm, addr, pte, zero_pte); | 1124 | set_pte_at(mm, addr, pte, zero_pte); |
1120 | } while (pte++, addr += PAGE_SIZE, addr != end); | 1125 | } while (pte++, addr += PAGE_SIZE, addr != end); |
1126 | arch_leave_lazy_mmu_mode(); | ||
1121 | pte_unmap_unlock(pte - 1, ptl); | 1127 | pte_unmap_unlock(pte - 1, ptl); |
1122 | return 0; | 1128 | return 0; |
1123 | } | 1129 | } |
@@ -1275,11 +1281,13 @@ static int remap_pte_range(struct mm_struct *mm, pmd_t *pmd, | |||
1275 | pte = pte_alloc_map_lock(mm, pmd, addr, &ptl); | 1281 | pte = pte_alloc_map_lock(mm, pmd, addr, &ptl); |
1276 | if (!pte) | 1282 | if (!pte) |
1277 | return -ENOMEM; | 1283 | return -ENOMEM; |
1284 | arch_enter_lazy_mmu_mode(); | ||
1278 | do { | 1285 | do { |
1279 | BUG_ON(!pte_none(*pte)); | 1286 | BUG_ON(!pte_none(*pte)); |
1280 | set_pte_at(mm, addr, pte, pfn_pte(pfn, prot)); | 1287 | set_pte_at(mm, addr, pte, pfn_pte(pfn, prot)); |
1281 | pfn++; | 1288 | pfn++; |
1282 | } while (pte++, addr += PAGE_SIZE, addr != end); | 1289 | } while (pte++, addr += PAGE_SIZE, addr != end); |
1290 | arch_leave_lazy_mmu_mode(); | ||
1283 | pte_unmap_unlock(pte - 1, ptl); | 1291 | pte_unmap_unlock(pte - 1, ptl); |
1284 | return 0; | 1292 | return 0; |
1285 | } | 1293 | } |