aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/mm/init.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-05-11 01:42:53 -0400
committerTony Luck <tony.luck@intel.com>2007-05-11 12:40:00 -0400
commit2bd62a40f63bd628c43a2f3637b252d0967659b0 (patch)
tree73b5dbda741421812f487ff0a9b753109fb105b4 /arch/ia64/mm/init.c
parentcdc7dbdfe6edac177acb32e4ca56b525d0743fe7 (diff)
[IA64] Quicklist support for IA64
IA64 is the origin of the quicklist implementation. So cut out the pieces that are now in core code and modify the functions called. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/mm/init.c')
-rw-r--r--arch/ia64/mm/init.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index cffb1e8325e8..c14abefabafa 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -39,9 +39,6 @@
39 39
40DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 40DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
41 41
42DEFINE_PER_CPU(unsigned long *, __pgtable_quicklist);
43DEFINE_PER_CPU(long, __pgtable_quicklist_size);
44
45extern void ia64_tlb_init (void); 42extern void ia64_tlb_init (void);
46 43
47unsigned long MAX_DMA_ADDRESS = PAGE_OFFSET + 0x100000000UL; 44unsigned long MAX_DMA_ADDRESS = PAGE_OFFSET + 0x100000000UL;
@@ -56,54 +53,6 @@ EXPORT_SYMBOL(vmem_map);
56struct page *zero_page_memmap_ptr; /* map entry for zero page */ 53struct page *zero_page_memmap_ptr; /* map entry for zero page */
57EXPORT_SYMBOL(zero_page_memmap_ptr); 54EXPORT_SYMBOL(zero_page_memmap_ptr);
58 55
59#define MIN_PGT_PAGES 25UL
60#define MAX_PGT_FREES_PER_PASS 16L
61#define PGT_FRACTION_OF_NODE_MEM 16
62
63static inline long
64max_pgt_pages(void)
65{
66 u64 node_free_pages, max_pgt_pages;
67
68#ifndef CONFIG_NUMA
69 node_free_pages = nr_free_pages();
70#else
71 node_free_pages = node_page_state(numa_node_id(), NR_FREE_PAGES);
72#endif
73 max_pgt_pages = node_free_pages / PGT_FRACTION_OF_NODE_MEM;
74 max_pgt_pages = max(max_pgt_pages, MIN_PGT_PAGES);
75 return max_pgt_pages;
76}
77
78static inline long
79min_pages_to_free(void)
80{
81 long pages_to_free;
82
83 pages_to_free = pgtable_quicklist_size - max_pgt_pages();
84 pages_to_free = min(pages_to_free, MAX_PGT_FREES_PER_PASS);
85 return pages_to_free;
86}
87
88void
89check_pgt_cache(void)
90{
91 long pages_to_free;
92
93 if (unlikely(pgtable_quicklist_size <= MIN_PGT_PAGES))
94 return;
95
96 preempt_disable();
97 while (unlikely((pages_to_free = min_pages_to_free()) > 0)) {
98 while (pages_to_free--) {
99 free_page((unsigned long)pgtable_quicklist_alloc());
100 }
101 preempt_enable();
102 preempt_disable();
103 }
104 preempt_enable();
105}
106
107void 56void
108lazy_mmu_prot_update (pte_t pte) 57lazy_mmu_prot_update (pte_t pte)
109{ 58{