2 * linux/include/asm-arm/tlb.h
4 * Copyright (C) 2002 Russell King
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * Experimentation shows that on a StrongARM, it appears to be faster
11 * to use the "invalidate whole tlb" rather than "invalidate single
14 * This appears true for both the process fork+exit case, as well as
15 * the munmap-large-area case.
17 #ifndef __ASMARM_TLB_H
18 #define __ASMARM_TLB_H
20 #include <asm/cacheflush.h>
21 #include <asm/tlbflush.h>
22 #include <asm/pgalloc.h>
23 #include <linux/vs_memory.h>
26 * TLB handling. This allows us to remove pages from the page
27 * tables, and efficiently handle the TLB issues.
35 unsigned int avoided_flushes;
38 DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
40 static inline struct mmu_gather *
41 tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
43 int cpu = smp_processor_id();
44 struct mmu_gather *tlb = &per_cpu(mmu_gathers, cpu);
48 tlb->fullmm = full_mm_flush;
54 tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
56 struct mm_struct *mm = tlb->mm;
57 unsigned long freed = tlb->freed;
62 // mm->rss = rss - freed;
63 vx_rsspages_sub(mm, freed);
69 tlb->avoided_flushes++;
72 /* keep the page table cache within bounds */
76 static inline unsigned int
77 tlb_is_full_mm(struct mmu_gather *tlb)
82 #define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0)
84 #define tlb_start_vma(tlb,vma) \
87 flush_cache_range(vma, vma->vm_start, vma->vm_end); \
90 #define tlb_end_vma(tlb,vma) do { } while (0)
92 #define tlb_remove_page(tlb,page) free_page_and_swap_cache(page)
93 #define pte_free_tlb(tlb,ptep) pte_free(ptep)
94 #define pmd_free_tlb(tlb,pmdp) pmd_free(pmdp)
96 #define tlb_migrate_finish(mm) do { } while (0)