Commit 8defab33774a5c33920196a2ee9c0a946d22ba67
Committed by
Linus Torvalds
1 parent
34013886ef
FRV: Replace pgd management via slabs through quicklists
This is done in order to be able to run SLUB which expects no modifications to its page structs. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 4 changed files with 22 additions and 14 deletions Side-by-side Diff
arch/frv/Kconfig
... | ... | @@ -45,15 +45,15 @@ |
45 | 45 | bool |
46 | 46 | default y |
47 | 47 | |
48 | -config ARCH_HAS_ILOG2_U32 | |
48 | +config QUICKLIST | |
49 | 49 | bool |
50 | 50 | default y |
51 | 51 | |
52 | -config ARCH_HAS_ILOG2_U64 | |
52 | +config ARCH_HAS_ILOG2_U32 | |
53 | 53 | bool |
54 | 54 | default y |
55 | 55 | |
56 | -config ARCH_USES_SLAB_PAGE_STRUCT | |
56 | +config ARCH_HAS_ILOG2_U64 | |
57 | 57 | bool |
58 | 58 | default y |
59 | 59 |
arch/frv/kernel/process.c
... | ... | @@ -25,12 +25,14 @@ |
25 | 25 | #include <linux/elf.h> |
26 | 26 | #include <linux/reboot.h> |
27 | 27 | #include <linux/interrupt.h> |
28 | +#include <linux/pagemap.h> | |
28 | 29 | |
29 | 30 | #include <asm/asm-offsets.h> |
30 | 31 | #include <asm/uaccess.h> |
31 | 32 | #include <asm/system.h> |
32 | 33 | #include <asm/setup.h> |
33 | 34 | #include <asm/pgtable.h> |
35 | +#include <asm/tlb.h> | |
34 | 36 | #include <asm/gdb-stub.h> |
35 | 37 | #include <asm/mb-regs.h> |
36 | 38 | |
... | ... | @@ -87,6 +89,8 @@ |
87 | 89 | while (1) { |
88 | 90 | while (!need_resched()) { |
89 | 91 | irq_stat[cpu].idle_timestamp = jiffies; |
92 | + | |
93 | + check_pgt_cache(); | |
90 | 94 | |
91 | 95 | if (!frv_dma_inprogress && idle) |
92 | 96 | idle(); |
arch/frv/mm/pgalloc.c
... | ... | @@ -13,12 +13,12 @@ |
13 | 13 | #include <linux/slab.h> |
14 | 14 | #include <linux/mm.h> |
15 | 15 | #include <linux/highmem.h> |
16 | +#include <linux/quicklist.h> | |
16 | 17 | #include <asm/pgalloc.h> |
17 | 18 | #include <asm/page.h> |
18 | 19 | #include <asm/cacheflush.h> |
19 | 20 | |
20 | 21 | pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((aligned(PAGE_SIZE))); |
21 | -struct kmem_cache *pgd_cache; | |
22 | 22 | |
23 | 23 | pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) |
24 | 24 | { |
... | ... | @@ -100,7 +100,7 @@ |
100 | 100 | set_page_private(next, (unsigned long) pprev); |
101 | 101 | } |
102 | 102 | |
103 | -void pgd_ctor(void *pgd, struct kmem_cache *cache, unsigned long unused) | |
103 | +void pgd_ctor(void *pgd) | |
104 | 104 | { |
105 | 105 | unsigned long flags; |
106 | 106 | |
... | ... | @@ -120,7 +120,7 @@ |
120 | 120 | } |
121 | 121 | |
122 | 122 | /* never called when PTRS_PER_PMD > 1 */ |
123 | -void pgd_dtor(void *pgd, struct kmem_cache *cache, unsigned long unused) | |
123 | +void pgd_dtor(void *pgd) | |
124 | 124 | { |
125 | 125 | unsigned long flags; /* can be called from interrupt context */ |
126 | 126 | |
... | ... | @@ -133,7 +133,7 @@ |
133 | 133 | { |
134 | 134 | pgd_t *pgd; |
135 | 135 | |
136 | - pgd = kmem_cache_alloc(pgd_cache, GFP_KERNEL); | |
136 | + pgd = quicklist_alloc(0, GFP_KERNEL, pgd_ctor); | |
137 | 137 | if (!pgd) |
138 | 138 | return pgd; |
139 | 139 | |
140 | 140 | |
... | ... | @@ -143,16 +143,15 @@ |
143 | 143 | void pgd_free(pgd_t *pgd) |
144 | 144 | { |
145 | 145 | /* in the non-PAE case, clear_page_tables() clears user pgd entries */ |
146 | - kmem_cache_free(pgd_cache, pgd); | |
146 | + quicklist_free(0, pgd_dtor, pgd); | |
147 | 147 | } |
148 | 148 | |
149 | 149 | void __init pgtable_cache_init(void) |
150 | 150 | { |
151 | - pgd_cache = kmem_cache_create("pgd", | |
152 | - PTRS_PER_PGD * sizeof(pgd_t), | |
153 | - PTRS_PER_PGD * sizeof(pgd_t), | |
154 | - SLAB_PANIC, | |
155 | - pgd_ctor, | |
156 | - pgd_dtor); | |
151 | +} | |
152 | + | |
153 | +void check_pgt_cache(void) | |
154 | +{ | |
155 | + quicklist_trim(0, pgd_dtor, 25, 16); | |
157 | 156 | } |
include/asm-frv/tlb.h