diff options
author | David Miller <davem@davemloft.net> | 2007-05-06 17:49:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-07 15:12:54 -0400 |
commit | 3a2cba993b0a04f258ab75e15cf3f08ada268dbd (patch) | |
tree | 7f20f6cad40c1efe18dcf5eadfb8abbc3353f9aa | |
parent | 6225e93735acaa09865bce746958f1046c2e0bc3 (diff) |
Quicklist support for sparc64
I ported this to sparc64 as per the patch below, tested on UP SunBlade1500 and
24 cpu Niagara T1000.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Andi Kleen <ak@suse.de>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: William Lee Irwin III <wli@holomorphy.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/sparc64/Kconfig | 4 | ||||
-rw-r--r-- | arch/sparc64/mm/init.c | 24 | ||||
-rw-r--r-- | arch/sparc64/mm/tsb.c | 2 | ||||
-rw-r--r-- | include/asm-sparc64/pgalloc.h | 26 |
4 files changed, 19 insertions, 37 deletions
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig index be9e10b94ef8..ad8d6b256a70 100644 --- a/arch/sparc64/Kconfig +++ b/arch/sparc64/Kconfig | |||
@@ -34,6 +34,10 @@ config MMU | |||
34 | bool | 34 | bool |
35 | default y | 35 | default y |
36 | 36 | ||
37 | config QUICKLIST | ||
38 | bool | ||
39 | default y | ||
40 | |||
37 | config STACKTRACE_SUPPORT | 41 | config STACKTRACE_SUPPORT |
38 | bool | 42 | bool |
39 | default y | 43 | default y |
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index cafadcbcdf38..d7004eaf1c8e 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -164,30 +164,6 @@ unsigned long sparc64_kern_sec_context __read_mostly; | |||
164 | 164 | ||
165 | int bigkernel = 0; | 165 | int bigkernel = 0; |
166 | 166 | ||
167 | struct kmem_cache *pgtable_cache __read_mostly; | ||
168 | |||
169 | static void zero_ctor(void *addr, struct kmem_cache *cache, unsigned long flags) | ||
170 | { | ||
171 | clear_page(addr); | ||
172 | } | ||
173 | |||
174 | extern void tsb_cache_init(void); | ||
175 | |||
176 | void pgtable_cache_init(void) | ||
177 | { | ||
178 | pgtable_cache = kmem_cache_create("pgtable_cache", | ||
179 | PAGE_SIZE, PAGE_SIZE, | ||
180 | SLAB_HWCACHE_ALIGN | | ||
181 | SLAB_MUST_HWCACHE_ALIGN, | ||
182 | zero_ctor, | ||
183 | NULL); | ||
184 | if (!pgtable_cache) { | ||
185 | prom_printf("Could not create pgtable_cache\n"); | ||
186 | prom_halt(); | ||
187 | } | ||
188 | tsb_cache_init(); | ||
189 | } | ||
190 | |||
191 | #ifdef CONFIG_DEBUG_DCFLUSH | 167 | #ifdef CONFIG_DEBUG_DCFLUSH |
192 | atomic_t dcpage_flushes = ATOMIC_INIT(0); | 168 | atomic_t dcpage_flushes = ATOMIC_INIT(0); |
193 | #ifdef CONFIG_SMP | 169 | #ifdef CONFIG_SMP |
diff --git a/arch/sparc64/mm/tsb.c b/arch/sparc64/mm/tsb.c index 236d02f41a01..57eb3025537a 100644 --- a/arch/sparc64/mm/tsb.c +++ b/arch/sparc64/mm/tsb.c | |||
@@ -252,7 +252,7 @@ static const char *tsb_cache_names[8] = { | |||
252 | "tsb_1MB", | 252 | "tsb_1MB", |
253 | }; | 253 | }; |
254 | 254 | ||
255 | void __init tsb_cache_init(void) | 255 | void __init pgtable_cache_init(void) |
256 | { | 256 | { |
257 | unsigned long i; | 257 | unsigned long i; |
258 | 258 | ||
diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h index 5891ff7ba760..5d66b858a965 100644 --- a/include/asm-sparc64/pgalloc.h +++ b/include/asm-sparc64/pgalloc.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
7 | #include <linux/mm.h> | 7 | #include <linux/mm.h> |
8 | #include <linux/slab.h> | 8 | #include <linux/slab.h> |
9 | #include <linux/quicklist.h> | ||
9 | 10 | ||
10 | #include <asm/spitfire.h> | 11 | #include <asm/spitfire.h> |
11 | #include <asm/cpudata.h> | 12 | #include <asm/cpudata.h> |
@@ -13,52 +14,50 @@ | |||
13 | #include <asm/page.h> | 14 | #include <asm/page.h> |
14 | 15 | ||
15 | /* Page table allocation/freeing. */ | 16 | /* Page table allocation/freeing. */ |
16 | extern struct kmem_cache *pgtable_cache; | ||
17 | 17 | ||
18 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) | 18 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) |
19 | { | 19 | { |
20 | return kmem_cache_alloc(pgtable_cache, GFP_KERNEL); | 20 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
21 | } | 21 | } |
22 | 22 | ||
23 | static inline void pgd_free(pgd_t *pgd) | 23 | static inline void pgd_free(pgd_t *pgd) |
24 | { | 24 | { |
25 | kmem_cache_free(pgtable_cache, pgd); | 25 | quicklist_free(0, NULL, pgd); |
26 | } | 26 | } |
27 | 27 | ||
28 | #define pud_populate(MM, PUD, PMD) pud_set(PUD, PMD) | 28 | #define pud_populate(MM, PUD, PMD) pud_set(PUD, PMD) |
29 | 29 | ||
30 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) | 30 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) |
31 | { | 31 | { |
32 | return kmem_cache_alloc(pgtable_cache, | 32 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
33 | GFP_KERNEL|__GFP_REPEAT); | ||
34 | } | 33 | } |
35 | 34 | ||
36 | static inline void pmd_free(pmd_t *pmd) | 35 | static inline void pmd_free(pmd_t *pmd) |
37 | { | 36 | { |
38 | kmem_cache_free(pgtable_cache, pmd); | 37 | quicklist_free(0, NULL, pmd); |
39 | } | 38 | } |
40 | 39 | ||
41 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | 40 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, |
42 | unsigned long address) | 41 | unsigned long address) |
43 | { | 42 | { |
44 | return kmem_cache_alloc(pgtable_cache, | 43 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
45 | GFP_KERNEL|__GFP_REPEAT); | ||
46 | } | 44 | } |
47 | 45 | ||
48 | static inline struct page *pte_alloc_one(struct mm_struct *mm, | 46 | static inline struct page *pte_alloc_one(struct mm_struct *mm, |
49 | unsigned long address) | 47 | unsigned long address) |
50 | { | 48 | { |
51 | return virt_to_page(pte_alloc_one_kernel(mm, address)); | 49 | void *pg = quicklist_alloc(0, GFP_KERNEL, NULL); |
50 | return pg ? virt_to_page(pg) : NULL; | ||
52 | } | 51 | } |
53 | 52 | ||
54 | static inline void pte_free_kernel(pte_t *pte) | 53 | static inline void pte_free_kernel(pte_t *pte) |
55 | { | 54 | { |
56 | kmem_cache_free(pgtable_cache, pte); | 55 | quicklist_free(0, NULL, pte); |
57 | } | 56 | } |
58 | 57 | ||
59 | static inline void pte_free(struct page *ptepage) | 58 | static inline void pte_free(struct page *ptepage) |
60 | { | 59 | { |
61 | pte_free_kernel(page_address(ptepage)); | 60 | quicklist_free_page(0, NULL, ptepage); |
62 | } | 61 | } |
63 | 62 | ||
64 | 63 | ||
@@ -66,6 +65,9 @@ static inline void pte_free(struct page *ptepage) | |||
66 | #define pmd_populate(MM,PMD,PTE_PAGE) \ | 65 | #define pmd_populate(MM,PMD,PTE_PAGE) \ |
67 | pmd_populate_kernel(MM,PMD,page_address(PTE_PAGE)) | 66 | pmd_populate_kernel(MM,PMD,page_address(PTE_PAGE)) |
68 | 67 | ||
69 | #define check_pgt_cache() do { } while (0) | 68 | static inline void check_pgt_cache(void) |
69 | { | ||
70 | quicklist_trim(0, NULL, 25, 16); | ||
71 | } | ||
70 | 72 | ||
71 | #endif /* _SPARC64_PGALLOC_H */ | 73 | #endif /* _SPARC64_PGALLOC_H */ |