diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-06-16 13:16:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-16 16:16:16 -0400 |
commit | 8dab5241d06bfc9ee141ea78c56cde5070d7460d (patch) | |
tree | dd9dc3c64c17862b169f4cbe5fd4a108d960c920 /include/asm-x86_64/pgtable.h | |
parent | 679ce0ace6b1a07043bc3b405a34ddccad808886 (diff) |
Rework ptep_set_access_flags and fix sun4c
Some changes done a while ago to avoid pounding on ptep_set_access_flags and
update_mmu_cache in some race situations break sun4c which requires
update_mmu_cache() to always be called on minor faults.
This patch reworks ptep_set_access_flags() semantics, implementations and
callers so that it's now responsible for returning whether an update is
necessary or not (basically whether the PTE actually changed). This allow
fixing the sparc implementation to always return 1 on sun4c.
[akpm@linux-foundation.org: fixes, cleanups]
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: David Miller <davem@davemloft.net>
Cc: Mark Fortescue <mark@mtfhpc.demon.co.uk>
Acked-by: William Lee Irwin III <wli@holomorphy.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-x86_64/pgtable.h')
-rw-r--r-- | include/asm-x86_64/pgtable.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index 08b9831f2e14..0a71e0b9a619 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h | |||
@@ -395,12 +395,14 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
395 | * bit at the same time. */ | 395 | * bit at the same time. */ |
396 | #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS | 396 | #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS |
397 | #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ | 397 | #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ |
398 | do { \ | 398 | ({ \ |
399 | if (__dirty) { \ | 399 | int __changed = !pte_same(*(__ptep), __entry); \ |
400 | set_pte(__ptep, __entry); \ | 400 | if (__changed && __dirty) { \ |
401 | flush_tlb_page(__vma, __address); \ | 401 | set_pte(__ptep, __entry); \ |
402 | } \ | 402 | flush_tlb_page(__vma, __address); \ |
403 | } while (0) | 403 | } \ |
404 | __changed; \ | ||
405 | }) | ||
404 | 406 | ||
405 | /* Encode and de-code a swap entry */ | 407 | /* Encode and de-code a swap entry */ |
406 | #define __swp_type(x) (((x).val >> 1) & 0x3f) | 408 | #define __swp_type(x) (((x).val >> 1) & 0x3f) |