aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm26
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-arm26')
-rw-r--r--include/asm-arm26/tlb.h35
1 files changed, 13 insertions, 22 deletions
diff --git a/include/asm-arm26/tlb.h b/include/asm-arm26/tlb.h
index c7d54ca0a239..08ddd85b8d35 100644
--- a/include/asm-arm26/tlb.h
+++ b/include/asm-arm26/tlb.h
@@ -10,11 +10,8 @@
10 */ 10 */
11struct mmu_gather { 11struct mmu_gather {
12 struct mm_struct *mm; 12 struct mm_struct *mm;
13 unsigned int freed; 13 unsigned int need_flush;
14 unsigned int fullmm; 14 unsigned int fullmm;
15
16 unsigned int flushes;
17 unsigned int avoided_flushes;
18}; 15};
19 16
20DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); 17DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
@@ -25,8 +22,8 @@ tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
25 struct mmu_gather *tlb = &get_cpu_var(mmu_gathers); 22 struct mmu_gather *tlb = &get_cpu_var(mmu_gathers);
26 23
27 tlb->mm = mm; 24 tlb->mm = mm;
28 tlb->freed = 0; 25 tlb->need_flush = 0;
29 tlb->fullmm = full_mm_flush; 26 tlb->fullmm = full_mm_flush;
30 27
31 return tlb; 28 return tlb;
32} 29}
@@ -34,20 +31,8 @@ tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
34static inline void 31static inline void
35tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) 32tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
36{ 33{
37 struct mm_struct *mm = tlb->mm; 34 if (tlb->need_flush)
38 unsigned long freed = tlb->freed; 35 flush_tlb_mm(tlb->mm);
39 int rss = get_mm_counter(mm, rss);
40
41 if (rss < freed)
42 freed = rss;
43 add_mm_counter(mm, rss, -freed);
44
45 if (freed) {
46 flush_tlb_mm(mm);
47 tlb->flushes++;
48 } else {
49 tlb->avoided_flushes++;
50 }
51 36
52 /* keep the page table cache within bounds */ 37 /* keep the page table cache within bounds */
53 check_pgt_cache(); 38 check_pgt_cache();
@@ -65,7 +50,13 @@ tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
65 } while (0) 50 } while (0)
66#define tlb_end_vma(tlb,vma) do { } while (0) 51#define tlb_end_vma(tlb,vma) do { } while (0)
67 52
68#define tlb_remove_page(tlb,page) free_page_and_swap_cache(page) 53static inline void
54tlb_remove_page(struct mmu_gather *tlb, struct page *page)
55{
56 tlb->need_flush = 1;
57 free_page_and_swap_cache(page);
58}
59
69#define pte_free_tlb(tlb,ptep) pte_free(ptep) 60#define pte_free_tlb(tlb,ptep) pte_free(ptep)
70#define pmd_free_tlb(tlb,pmdp) pmd_free(pmdp) 61#define pmd_free_tlb(tlb,pmdp) pmd_free(pmdp)
71 62