diff options
-rw-r--r-- | include/asm-generic/pgtable.h | 9 | ||||
-rw-r--r-- | mm/fremap.c | 2 | ||||
-rw-r--r-- | mm/memory.c | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 349260cd86ed..78740716c9e7 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -112,8 +112,13 @@ do { \ | |||
112 | }) | 112 | }) |
113 | #endif | 113 | #endif |
114 | 114 | ||
115 | #ifndef __HAVE_ARCH_PTE_CLEAR_FULL | 115 | /* |
116 | #define pte_clear_full(__mm, __address, __ptep, __full) \ | 116 | * Some architectures may be able to avoid expensive synchronization |
117 | * primitives when modifications are made to PTE's which are already | ||
118 | * not present, or in the process of an address space destruction. | ||
119 | */ | ||
120 | #ifndef __HAVE_ARCH_PTE_CLEAR_NOT_PRESENT_FULL | ||
121 | #define pte_clear_not_present_full(__mm, __address, __ptep, __full) \ | ||
117 | do { \ | 122 | do { \ |
118 | pte_clear((__mm), (__address), (__ptep)); \ | 123 | pte_clear((__mm), (__address), (__ptep)); \ |
119 | } while (0) | 124 | } while (0) |
diff --git a/mm/fremap.c b/mm/fremap.c index aa30618ec6b2..7a9d0f5d246d 100644 --- a/mm/fremap.c +++ b/mm/fremap.c | |||
@@ -39,7 +39,7 @@ static int zap_pte(struct mm_struct *mm, struct vm_area_struct *vma, | |||
39 | } else { | 39 | } else { |
40 | if (!pte_file(pte)) | 40 | if (!pte_file(pte)) |
41 | free_swap_and_cache(pte_to_swp_entry(pte)); | 41 | free_swap_and_cache(pte_to_swp_entry(pte)); |
42 | pte_clear(mm, addr, ptep); | 42 | pte_clear_not_present_full(mm, addr, ptep, 0); |
43 | } | 43 | } |
44 | return !!page; | 44 | return !!page; |
45 | } | 45 | } |
diff --git a/mm/memory.c b/mm/memory.c index 7707187484cc..2e754621d333 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -690,7 +690,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb, | |||
690 | continue; | 690 | continue; |
691 | if (!pte_file(ptent)) | 691 | if (!pte_file(ptent)) |
692 | free_swap_and_cache(pte_to_swp_entry(ptent)); | 692 | free_swap_and_cache(pte_to_swp_entry(ptent)); |
693 | pte_clear_full(mm, addr, pte, tlb->fullmm); | 693 | pte_clear_not_present_full(mm, addr, pte, tlb->fullmm); |
694 | } while (pte++, addr += PAGE_SIZE, (addr != end && *zap_work > 0)); | 694 | } while (pte++, addr += PAGE_SIZE, (addr != end && *zap_work > 0)); |
695 | 695 | ||
696 | add_mm_rss(mm, file_rss, anon_rss); | 696 | add_mm_rss(mm, file_rss, anon_rss); |