diff options
| author | Andrew Morton <akpm@zip.com.au> | 2002-08-27 21:02:52 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@penguin.transmeta.com> | 2002-08-27 21:02:52 -0700 |
| commit | 37717bca9aa497e148c024fe94db71832f9f92ca (patch) | |
| tree | 0a174facaeefad87ccd192ca891e45e72bd30959 /include/asm-sparc | |
| parent | ec4affa64b3d1342e107fb7352827e69af862c28 (diff) | |
[PATCH] reduced TLB invalidation rate
It has been noticed that across a kernel build many calls to
tlb_flush_mmu() do not have anything to flush, apparently because glibc
is mmapping a file over a previously-mapped region which has no
faulted-in ptes.
This patch detects this case and optimises away a little over one third
of the tlb invalidations.
The functions which potentially cause an invalidate are
tlb_remove_tlb_entry(), pte_free_tlb() and pmd_free_tlb(). These have
been front-ended in asm-generic/tlb.h and the per-arch versions now
have leading double-underscores. The generic versions tag the
mmu_gather_t as needing a flush and then call the arch-specific
version.
tlb_flush_mmu() looks at tlb->need_flush and if it sees that no real
activity has happened, the invalidation is avoided.
The success rate is displayed in /proc/meminfo for the while. This
should be removed later.
Diffstat (limited to 'include/asm-sparc')
| -rw-r--r-- | include/asm-sparc/pgalloc.h | 4 | ||||
| -rw-r--r-- | include/asm-sparc/tlb.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/asm-sparc/pgalloc.h b/include/asm-sparc/pgalloc.h index 09c9decddbc4..126800acd10d 100644 --- a/include/asm-sparc/pgalloc.h +++ b/include/asm-sparc/pgalloc.h @@ -47,7 +47,7 @@ BTFIXUPDEF_CALL(void, free_pmd_fast, pmd_t *) #define free_pmd_fast(pmd) BTFIXUP_CALL(free_pmd_fast)(pmd) #define pmd_free(pmd) free_pmd_fast(pmd) -#define pmd_free_tlb(tlb, pmd) pmd_free(pmd) +#define __pmd_free_tlb(tlb, pmd) pmd_free(pmd) BTFIXUPDEF_CALL(void, pmd_populate, pmd_t *, struct page *) #define pmd_populate(MM, PMD, PTE) BTFIXUP_CALL(pmd_populate)(PMD, PTE) @@ -64,6 +64,6 @@ BTFIXUPDEF_CALL(void, free_pte_fast, pte_t *) BTFIXUPDEF_CALL(void, pte_free, struct page *) #define pte_free(pte) BTFIXUP_CALL(pte_free)(pte) -#define pte_free_tlb(tlb, pte) pte_free(pte) +#define __pte_free_tlb(tlb, pte) pte_free(pte) #endif /* _SPARC_PGALLOC_H */ diff --git a/include/asm-sparc/tlb.h b/include/asm-sparc/tlb.h index c9344b8767b4..6d02d1ce53f3 100644 --- a/include/asm-sparc/tlb.h +++ b/include/asm-sparc/tlb.h @@ -11,7 +11,7 @@ do { \ flush_tlb_range(vma, vma->vm_start, vma->vm_end); \ } while (0) -#define tlb_remove_tlb_entry(tlb, pte, address) \ +#define __tlb_remove_tlb_entry(tlb, pte, address) \ do { } while (0) #define tlb_flush(tlb) \ |
