Skip to contentSkip to conversation

use a slab cache for pte_chains

PATCH In review Andrew Morton 1 participant 1 message Jul 28, 2002

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 3/13 use a slab cache for pte_chains

Patch from Bill Irwin.

It removes the custom pte_chain allocator in mm/rmap.c and replaces it with a slab cache.

"This patch
(1) eliminates the pte_chain_freelist_lock and all contention on it
(2) gives the VM the ability to recover unused pte_chain pages

Anton Blanchard has reported (1) from prior incarnations of this patch. Craig Kulesa has reported (2) in combination with slab-on-LRU patches.

I've left OOM detection out of this patch entirely as upcoming patches will do real OOM handling for pte_chains and all the code changed anyway."

 fs/proc/proc_misc.c        |    6 +--
 include/linux/page-flags.h |    3 -
 init/main.c                |    4 +-
 mm/page_alloc.c            |    3 -
 mm/rmap.c                  |   82 +++++++++------------------------------------
 5 files changed, 23 insertions(+), 75 deletions(-)
fs/proc/proc_misc.c renamed from fs/proc/proc_misc.c~pte_chain_slab +2 -4
@@ -161,8 +161,7 @@ static int meminfo_read_proc(char *page,
 		"Dirty:        %8lu kB\n"
 		"Writeback:    %8lu kB\n"
 		"PageTables:   %8lu kB\n"
-		"PteChainTot:  %8lu kB\n"
-		"PteChainUsed: %8lu kB\n",
+		"ReverseMaps:  %8lu\n",
 		K(i.totalram),
 		K(i.freeram),
 		K(i.sharedram),
@@ -179,8 +178,7 @@ static int meminfo_read_proc(char *page,
 		K(ps.nr_dirty),
 		K(ps.nr_writeback),
 		K(ps.nr_page_table_pages),
-		K(ps.nr_pte_chain_pages),
-		ps.used_pte_chains_bytes >> 10
+		ps.nr_reverse_maps
 		);
 
 	return proc_calc_metrics(page, start, off, count, eof, len);
include/linux/page-flags.h renamed from include/linux/page-flags.h~pte_chain_slab +1 -2
@@ -79,8 +79,7 @@ extern struct page_state {
 	unsigned long nr_active;	/* on active_list LRU */
 	unsigned long nr_inactive;	/* on inactive_list LRU */
 	unsigned long nr_page_table_pages;
-	unsigned long nr_pte_chain_pages;
-	unsigned long used_pte_chains_bytes;
+	unsigned long nr_reverse_maps;
 } ____cacheline_aligned_in_smp page_states[NR_CPUS];
 
 extern void get_page_state(struct page_state *ret);
init/main.c renamed from init/main.c~pte_chain_slab +2 -2
@@ -70,7 +70,7 @@ extern void sbus_init(void);
 extern void sysctl_init(void);
 extern void signals_init(void);
 extern void buffer_init(void);
-
+extern void pte_chain_init(void);
 extern void radix_tree_init(void);
 extern void free_initmem(void);
 
@@ -432,7 +432,7 @@ asmlinkage void __init start_kernel(void
 	mem_init();
 	kmem_cache_sizes_init();
 	pgtable_cache_init();
-
+	pte_chain_init();
 	mempages = num_physpages;
 
 	fork_init(mempages);
mm/page_alloc.c renamed from mm/page_alloc.c~pte_chain_slab +1 -2
@@ -567,8 +567,7 @@ void get_page_state(struct page_state *r
 		ret->nr_active += ps->nr_active;
 		ret->nr_inactive += ps->nr_inactive;
 		ret->nr_page_table_pages += ps->nr_page_table_pages;
-		ret->nr_pte_chain_pages += ps->nr_pte_chain_pages;
-		ret->used_pte_chains_bytes += ps->used_pte_chains_bytes;
+		ret->nr_reverse_maps += ps->nr_reverse_maps;
 	}
 }
 
mm/rmap.c renamed from mm/rmap.c~pte_chain_slab +17 -65

137 lines not on this page · raw message

.