Commit 9888a1cae3f859db38b9604e3df1c02177161bb0

Authored by Zachary Amsden
Committed by Linus Torvalds
1 parent 3dc9079514

[PATCH] paravirt: pte clear not present

Change pte_clear_full to a more appropriately named pte_clear_not_present,
allowing optimizations when not-present mapping changes need not be reflected
in the hardware TLB for protected page table modes.  There is also another
case that can use it in the fremap code.

Signed-off-by: Zachary Amsden <zach@vmware.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 3 changed files with 9 additions and 4 deletions Side-by-side Diff

include/asm-generic/pgtable.h
... ... @@ -112,8 +112,13 @@
112 112 })
113 113 #endif
114 114  
115   -#ifndef __HAVE_ARCH_PTE_CLEAR_FULL
116   -#define pte_clear_full(__mm, __address, __ptep, __full) \
  115 +/*
  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 122 do { \
118 123 pte_clear((__mm), (__address), (__ptep)); \
119 124 } while (0)
... ... @@ -39,7 +39,7 @@
39 39 } else {
40 40 if (!pte_file(pte))
41 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 44 return !!page;
45 45 }
... ... @@ -690,7 +690,7 @@
690 690 continue;
691 691 if (!pte_file(ptent))
692 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 694 } while (pte++, addr += PAGE_SIZE, (addr != end && *zap_work > 0));
695 695  
696 696 add_mm_rss(mm, file_rss, anon_rss);