aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-arm/tlb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-arm/tlb.h')
-rw-r--r--include/asm-arm/tlb.h23
1 files changed, 3 insertions, 20 deletions
diff --git a/include/asm-arm/tlb.h b/include/asm-arm/tlb.h
index 9bb325c54645..f49bfb78c221 100644
--- a/include/asm-arm/tlb.h
+++ b/include/asm-arm/tlb.h
@@ -27,11 +27,7 @@
27 */ 27 */
28struct mmu_gather { 28struct mmu_gather {
29 struct mm_struct *mm; 29 struct mm_struct *mm;
30 unsigned int freed;
31 unsigned int fullmm; 30 unsigned int fullmm;
32
33 unsigned int flushes;
34 unsigned int avoided_flushes;
35}; 31};
36 32
37DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); 33DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
@@ -39,11 +35,9 @@ DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
39static inline struct mmu_gather * 35static inline struct mmu_gather *
40tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) 36tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
41{ 37{
42 int cpu = smp_processor_id(); 38 struct mmu_gather *tlb = &get_cpu_var(mmu_gathers);
43 struct mmu_gather *tlb = &per_cpu(mmu_gathers, cpu);
44 39
45 tlb->mm = mm; 40 tlb->mm = mm;
46 tlb->freed = 0;
47 tlb->fullmm = full_mm_flush; 41 tlb->fullmm = full_mm_flush;
48 42
49 return tlb; 43 return tlb;
@@ -52,24 +46,13 @@ tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
52static inline void 46static inline void
53tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) 47tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
54{ 48{
55 struct mm_struct *mm = tlb->mm;
56 unsigned long freed = tlb->freed;
57 int rss = get_mm_counter(mm, rss);
58
59 if (rss < freed)
60 freed = rss;
61 add_mm_counter(mm, rss, -freed);
62
63 if (tlb->fullmm) 49 if (tlb->fullmm)
64 flush_tlb_mm(mm); 50 flush_tlb_mm(tlb->mm);
65 51
66 /* keep the page table cache within bounds */ 52 /* keep the page table cache within bounds */
67 check_pgt_cache(); 53 check_pgt_cache();
68}
69 54
70static inline unsigned int tlb_is_full_mm(struct mmu_gather *tlb) 55 put_cpu_var(mmu_gathers);
71{
72 return tlb->fullmm;
73} 56}
74 57
75#define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0) 58#define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0)