Skip to contentSkip to conversation

pte_chain_mempool-2.5.27-2

PATCH William Lee Irwin III 1 participant 1 message Jul 22, 2002

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

This patch uses mempool with the slab cache as a front end for pte_chains. This solves 3 problems simultaneously:

(1) providing a way to reclaim unused pages formerly on the pte_chain_freelist
(2) robustness of pte_chain allocation is increased by using mempool (though OOM is still not truly handled)
(3) lock contention on the pte_chain_freelist_lock, observed by Anton Blanchard, is eliminated by means of the slab cache's per-cpu mechanisms.

Someone reported that the nr_reverse_maps used K() in /proc/meminfo unnecessarily, and this release's only update is the reparation of that.

ps.nr_reverse_maps accounts the total number of reverse mappings performed, which cannot be accounted by space consumption as Dave McCracken's optimization of folding the pte pointer for a singly mapped page into the struct page defeats that. The nr_pte_chain_pages and nr_used_pte_chains_bytes are now derivable from /proc/slabinfo and so are removed.

Cheers,
Bill

===== fs/proc/proc_misc.c 1.31 vs edited =====

fs/proc/proc_misc.c +2 -4
@@ -161,8 +161,7 @@
 		"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 @@
 		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 1.12 vs edited =====

include/linux/page-flags.h +1 -2
@@ -79,8 +79,7 @@
 	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 1.51 vs edited =====

init/main.c +2 -2
@@ -70,7 +70,7 @@
 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);
 
@@ -386,7 +386,7 @@
 	mem_init();
 	kmem_cache_sizes_init();
 	pgtable_cache_init();
-
+	pte_chain_init();
 	mempages = num_physpages;
 
 	fork_init(mempages);

===== mm/page_alloc.c 1.82 vs edited =====

mm/page_alloc.c +1 -2
@@ -566,8 +566,7 @@
 		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 1.3 vs edited =====

mm/rmap.c +37 -62

155 lines not on this page · raw message