diff options
author | Christoph Lameter <clameter@sgi.com> | 2007-05-11 01:42:53 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2007-05-11 12:40:00 -0400 |
commit | 2bd62a40f63bd628c43a2f3637b252d0967659b0 (patch) | |
tree | 73b5dbda741421812f487ff0a9b753109fb105b4 /arch/ia64 | |
parent | cdc7dbdfe6edac177acb32e4ca56b525d0743fe7 (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')
-rw-r--r-- | arch/ia64/Kconfig | 4 | ||||
-rw-r--r-- | arch/ia64/mm/contig.c | 2 | ||||
-rw-r--r-- | arch/ia64/mm/discontig.c | 2 | ||||
-rw-r--r-- | arch/ia64/mm/init.c | 51 |
4 files changed, 6 insertions, 53 deletions
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 6e41471449c0..de1bff659969 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -31,6 +31,10 @@ config ZONE_DMA | |||
31 | def_bool y | 31 | def_bool y |
32 | depends on !IA64_SGI_SN2 | 32 | depends on !IA64_SGI_SN2 |
33 | 33 | ||
34 | config QUICKLIST | ||
35 | bool | ||
36 | default y | ||
37 | |||
34 | config MMU | 38 | config MMU |
35 | bool | 39 | bool |
36 | default y | 40 | default y |
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c index 44ce5ed9444c..7ac8592a35b6 100644 --- a/arch/ia64/mm/contig.c +++ b/arch/ia64/mm/contig.c | |||
@@ -88,7 +88,7 @@ void show_mem(void) | |||
88 | printk(KERN_INFO "%d pages shared\n", total_shared); | 88 | printk(KERN_INFO "%d pages shared\n", total_shared); |
89 | printk(KERN_INFO "%d pages swap cached\n", total_cached); | 89 | printk(KERN_INFO "%d pages swap cached\n", total_cached); |
90 | printk(KERN_INFO "Total of %ld pages in page table cache\n", | 90 | printk(KERN_INFO "Total of %ld pages in page table cache\n", |
91 | pgtable_quicklist_total_size()); | 91 | quicklist_total_size()); |
92 | printk(KERN_INFO "%d free buffer pages\n", nr_free_buffer_pages()); | 92 | printk(KERN_INFO "%d free buffer pages\n", nr_free_buffer_pages()); |
93 | } | 93 | } |
94 | 94 | ||
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c index 94844442812a..38085ac18338 100644 --- a/arch/ia64/mm/discontig.c +++ b/arch/ia64/mm/discontig.c | |||
@@ -561,7 +561,7 @@ void show_mem(void) | |||
561 | printk(KERN_INFO "%d pages shared\n", total_shared); | 561 | printk(KERN_INFO "%d pages shared\n", total_shared); |
562 | printk(KERN_INFO "%d pages swap cached\n", total_cached); | 562 | printk(KERN_INFO "%d pages swap cached\n", total_cached); |
563 | printk(KERN_INFO "Total of %ld pages in page table cache\n", | 563 | printk(KERN_INFO "Total of %ld pages in page table cache\n", |
564 | pgtable_quicklist_total_size()); | 564 | quicklist_total_size()); |
565 | printk(KERN_INFO "%d free buffer pages\n", nr_free_buffer_pages()); | 565 | printk(KERN_INFO "%d free buffer pages\n", nr_free_buffer_pages()); |
566 | } | 566 | } |
567 | 567 | ||
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 | ||
40 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); | 40 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); |
41 | 41 | ||
42 | DEFINE_PER_CPU(unsigned long *, __pgtable_quicklist); | ||
43 | DEFINE_PER_CPU(long, __pgtable_quicklist_size); | ||
44 | |||
45 | extern void ia64_tlb_init (void); | 42 | extern void ia64_tlb_init (void); |
46 | 43 | ||
47 | unsigned long MAX_DMA_ADDRESS = PAGE_OFFSET + 0x100000000UL; | 44 | unsigned long MAX_DMA_ADDRESS = PAGE_OFFSET + 0x100000000UL; |
@@ -56,54 +53,6 @@ EXPORT_SYMBOL(vmem_map); | |||
56 | struct page *zero_page_memmap_ptr; /* map entry for zero page */ | 53 | struct page *zero_page_memmap_ptr; /* map entry for zero page */ |
57 | EXPORT_SYMBOL(zero_page_memmap_ptr); | 54 | EXPORT_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 | |||
63 | static inline long | ||
64 | max_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 | |||
78 | static inline long | ||
79 | min_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 | |||
88 | void | ||
89 | check_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 | |||
107 | void | 56 | void |
108 | lazy_mmu_prot_update (pte_t pte) | 57 | lazy_mmu_prot_update (pte_t pte) |
109 | { | 58 | { |