Commit 5045fffe authored by Andrew Morton's avatar Andrew Morton Committed by Christoph Hellwig

[PATCH] clean up the TLB takedown code, remove debug

- Remove the temp /proc/meminfo stats

- Make the mmu_gather_t be 2048 bytes again

- Removed unused variable (Oleg Nesterov)
parent 483a40e4
...@@ -136,16 +136,8 @@ static int meminfo_read_proc(char *page, char **start, off_t off, ...@@ -136,16 +136,8 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
struct sysinfo i; struct sysinfo i;
int len, committed; int len, committed;
struct page_state ps; struct page_state ps;
int cpu;
unsigned long inactive; unsigned long inactive;
unsigned long active; unsigned long active;
unsigned long flushes = 0;
unsigned long non_flushes = 0;
for (cpu = 0; cpu < NR_CPUS; cpu++) {
flushes += mmu_gathers[cpu].flushes;
non_flushes += mmu_gathers[cpu].avoided_flushes;
}
get_page_state(&ps); get_page_state(&ps);
get_zone_counts(&active, &inactive); get_zone_counts(&active, &inactive);
...@@ -181,9 +173,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off, ...@@ -181,9 +173,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
"Mapped: %8lu kB\n" "Mapped: %8lu kB\n"
"Committed_AS: %8u kB\n" "Committed_AS: %8u kB\n"
"PageTables: %8lu kB\n" "PageTables: %8lu kB\n"
"ReverseMaps: %8lu\n" "ReverseMaps: %8lu\n",
"TLB flushes: %8lu\n"
"non flushes: %8lu\n",
K(i.totalram), K(i.totalram),
K(i.freeram), K(i.freeram),
K(i.sharedram), K(i.sharedram),
...@@ -203,9 +193,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off, ...@@ -203,9 +193,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
K(ps.nr_mapped), K(ps.nr_mapped),
K(committed), K(committed),
K(ps.nr_page_table_pages), K(ps.nr_page_table_pages),
ps.nr_reverse_maps, ps.nr_reverse_maps
flushes,
non_flushes
); );
#ifdef CONFIG_HUGETLB_PAGE #ifdef CONFIG_HUGETLB_PAGE
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* and page free order so much.. * and page free order so much..
*/ */
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
#define FREE_PTE_NR 507 #define FREE_PTE_NR 506
#define tlb_fast_mode(tlb) ((tlb)->nr == ~0U) #define tlb_fast_mode(tlb) ((tlb)->nr == ~0U)
#else #else
#define FREE_PTE_NR 1 #define FREE_PTE_NR 1
...@@ -40,8 +40,6 @@ typedef struct free_pte_ctx { ...@@ -40,8 +40,6 @@ typedef struct free_pte_ctx {
unsigned int fullmm; /* non-zero means full mm flush */ unsigned int fullmm; /* non-zero means full mm flush */
unsigned long freed; unsigned long freed;
struct page * pages[FREE_PTE_NR]; struct page * pages[FREE_PTE_NR];
unsigned long flushes;/* stats: count avoided flushes */
unsigned long avoided_flushes;
} mmu_gather_t; } mmu_gather_t;
/* Users of the generic TLB shootdown code must declare this storage space. */ /* Users of the generic TLB shootdown code must declare this storage space. */
...@@ -67,17 +65,10 @@ static inline mmu_gather_t *tlb_gather_mmu(struct mm_struct *mm, unsigned int fu ...@@ -67,17 +65,10 @@ static inline mmu_gather_t *tlb_gather_mmu(struct mm_struct *mm, unsigned int fu
static inline void tlb_flush_mmu(mmu_gather_t *tlb, unsigned long start, unsigned long end) static inline void tlb_flush_mmu(mmu_gather_t *tlb, unsigned long start, unsigned long end)
{ {
unsigned long nr; if (!tlb->need_flush)
if (!tlb->need_flush) {
tlb->avoided_flushes++;
return; return;
}
tlb->need_flush = 0; tlb->need_flush = 0;
tlb->flushes++;
tlb_flush(tlb); tlb_flush(tlb);
nr = tlb->nr;
if (!tlb_fast_mode(tlb)) { if (!tlb_fast_mode(tlb)) {
free_pages_and_swap_cache(tlb->pages, tlb->nr); free_pages_and_swap_cache(tlb->pages, tlb->nr);
tlb->nr = 0; tlb->nr = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment