aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86_64/pgtable.h
diff options
context:
space:
mode:
authorZachary Amsden <zach@vmware.com>2005-09-03 18:55:06 -0400
committerLinus Torvalds <torvalds@evo.osdl.org>2005-09-05 03:05:48 -0400
commit61e06037e764337da39dff307cbcdbe9cf288349 (patch)
treee9719788c751c1d4a437c98056e2ddd7e34d5dfa /include/asm-x86_64/pgtable.h
parenta600388d28419305aad3c4c0af52c223cf6fa0af (diff)
[PATCH] x86_64: avoid some atomic operations during address space destruction
Any architecture that has hardware updated A/D bits that require synchronization against other processors during PTE operations can benefit from doing non-atomic PTE updates during address space destruction. Originally done on i386, now ported to x86_64. Doing a read/write pair instead of an xchg() operation saves the implicit lock, which turns out to be a big win on 32-bit (esp w PAE). Signed-off-by: Zachary Amsden <zach@vmware.com> Cc: Andi Kleen <ak@muc.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-x86_64/pgtable.h')
-rw-r--r--include/asm-x86_64/pgtable.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index a1ada852f00e..5e0f2fdab0d3 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -104,6 +104,19 @@ extern inline void pgd_clear (pgd_t * pgd)
104((unsigned long) __va(pud_val(pud) & PHYSICAL_PAGE_MASK)) 104((unsigned long) __va(pud_val(pud) & PHYSICAL_PAGE_MASK))
105 105
106#define ptep_get_and_clear(mm,addr,xp) __pte(xchg(&(xp)->pte, 0)) 106#define ptep_get_and_clear(mm,addr,xp) __pte(xchg(&(xp)->pte, 0))
107
108static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full)
109{
110 pte_t pte;
111 if (full) {
112 pte = *ptep;
113 *ptep = __pte(0);
114 } else {
115 pte = ptep_get_and_clear(mm, addr, ptep);
116 }
117 return pte;
118}
119
107#define pte_same(a, b) ((a).pte == (b).pte) 120#define pte_same(a, b) ((a).pte == (b).pte)
108 121
109#define PMD_SIZE (1UL << PMD_SHIFT) 122#define PMD_SIZE (1UL << PMD_SHIFT)
@@ -434,6 +447,7 @@ extern int kern_addr_valid(unsigned long addr);
434#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 447#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
435#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY 448#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
436#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 449#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
450#define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
437#define __HAVE_ARCH_PTEP_SET_WRPROTECT 451#define __HAVE_ARCH_PTEP_SET_WRPROTECT
438#define __HAVE_ARCH_PTE_SAME 452#define __HAVE_ARCH_PTE_SAME
439#include <asm-generic/pgtable.h> 453#include <asm-generic/pgtable.h>