diff options
author | Abhijit Karmarkar <abhijitk@veritas.com> | 2005-06-21 20:15:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-21 21:46:21 -0400 |
commit | b4955ce3dd0818b56da532a16c9a4a3804a558ee (patch) | |
tree | 6e01667181bfc495b56e39748783ad2235a4f56e /include/asm-generic/pgtable.h | |
parent | c475a8ab625d567eacf5e30ec35d6d8704558062 (diff) |
[PATCH] msync: check pte dirty earlier
It's common practice to msync a large address range regularly, in which
often only a few ptes have actually been dirtied since the previous pass.
sync_pte_range then goes much faster if it tests whether pte is dirty
before locating and accessing each struct page cacheline; and it is hardly
slowed by ptep_clear_flush_dirty repeating that test in the opposite case,
when every pte actually is dirty.
But beware, s390's pte_dirty always says false, since its dirty bit is kept
in the storage key, located via the struct page address. So skip this
optimization in its case: use a pte_maybe_dirty macro which just says true
if page_test_and_clear_dirty is implemented.
Signed-off-by: Abhijit Karmarkar <abhijitk@veritas.com>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-generic/pgtable.h')
-rw-r--r-- | include/asm-generic/pgtable.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 1f4ec7b70270..f40593565173 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -125,6 +125,9 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres | |||
125 | 125 | ||
126 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY | 126 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY |
127 | #define page_test_and_clear_dirty(page) (0) | 127 | #define page_test_and_clear_dirty(page) (0) |
128 | #define pte_maybe_dirty(pte) pte_dirty(pte) | ||
129 | #else | ||
130 | #define pte_maybe_dirty(pte) (1) | ||
128 | #endif | 131 | #endif |
129 | 132 | ||
130 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG | 133 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG |