diff options
| author | Christoph Lameter <clameter@sgi.com> | 2007-05-09 05:32:48 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-09 15:30:46 -0400 |
| commit | 8defab33774a5c33920196a2ee9c0a946d22ba67 (patch) | |
| tree | 6924e361156f6420c8c42aa614998e565096c6aa | |
| parent | 34013886ef47ea72e412beb04558431b57a68d51 (diff) | |
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>
| -rw-r--r-- | arch/frv/Kconfig | 6 | ||||
| -rw-r--r-- | arch/frv/kernel/process.c | 4 | ||||
| -rw-r--r-- | arch/frv/mm/pgalloc.c | 22 | ||||
| -rw-r--r-- | include/asm-frv/tlb.h | 4 |
4 files changed, 22 insertions, 14 deletions
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig index eed694312a79..114738a45582 100644 --- a/arch/frv/Kconfig +++ b/arch/frv/Kconfig | |||
| @@ -45,15 +45,15 @@ config TIME_LOW_RES | |||
| 45 | bool | 45 | bool |
| 46 | default y | 46 | default y |
| 47 | 47 | ||
| 48 | config ARCH_HAS_ILOG2_U32 | 48 | config QUICKLIST |
| 49 | bool | 49 | bool |
| 50 | default y | 50 | default y |
| 51 | 51 | ||
| 52 | config ARCH_HAS_ILOG2_U64 | 52 | config ARCH_HAS_ILOG2_U32 |
| 53 | bool | 53 | bool |
| 54 | default y | 54 | default y |
| 55 | 55 | ||
| 56 | config ARCH_USES_SLAB_PAGE_STRUCT | 56 | config ARCH_HAS_ILOG2_U64 |
| 57 | bool | 57 | bool |
| 58 | default y | 58 | default y |
| 59 | 59 | ||
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c index 515a5cea5469..9583a338e9d6 100644 --- a/arch/frv/kernel/process.c +++ b/arch/frv/kernel/process.c | |||
| @@ -25,12 +25,14 @@ | |||
| 25 | #include <linux/elf.h> | 25 | #include <linux/elf.h> |
| 26 | #include <linux/reboot.h> | 26 | #include <linux/reboot.h> |
| 27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
| 28 | #include <linux/pagemap.h> | ||
| 28 | 29 | ||
| 29 | #include <asm/asm-offsets.h> | 30 | #include <asm/asm-offsets.h> |
| 30 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
| 31 | #include <asm/system.h> | 32 | #include <asm/system.h> |
| 32 | #include <asm/setup.h> | 33 | #include <asm/setup.h> |
| 33 | #include <asm/pgtable.h> | 34 | #include <asm/pgtable.h> |
| 35 | #include <asm/tlb.h> | ||
| 34 | #include <asm/gdb-stub.h> | 36 | #include <asm/gdb-stub.h> |
| 35 | #include <asm/mb-regs.h> | 37 | #include <asm/mb-regs.h> |
| 36 | 38 | ||
| @@ -88,6 +90,8 @@ void cpu_idle(void) | |||
| 88 | while (!need_resched()) { | 90 | while (!need_resched()) { |
| 89 | irq_stat[cpu].idle_timestamp = jiffies; | 91 | irq_stat[cpu].idle_timestamp = jiffies; |
| 90 | 92 | ||
| 93 | check_pgt_cache(); | ||
| 94 | |||
| 91 | if (!frv_dma_inprogress && idle) | 95 | if (!frv_dma_inprogress && idle) |
| 92 | idle(); | 96 | idle(); |
| 93 | } | 97 | } |
diff --git a/arch/frv/mm/pgalloc.c b/arch/frv/mm/pgalloc.c index 598a26ab8ad8..7787c3cc52c6 100644 --- a/arch/frv/mm/pgalloc.c +++ b/arch/frv/mm/pgalloc.c | |||
| @@ -13,12 +13,12 @@ | |||
| 13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
| 14 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
| 15 | #include <linux/highmem.h> | 15 | #include <linux/highmem.h> |
| 16 | #include <linux/quicklist.h> | ||
| 16 | #include <asm/pgalloc.h> | 17 | #include <asm/pgalloc.h> |
| 17 | #include <asm/page.h> | 18 | #include <asm/page.h> |
| 18 | #include <asm/cacheflush.h> | 19 | #include <asm/cacheflush.h> |
| 19 | 20 | ||
| 20 | pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((aligned(PAGE_SIZE))); | 21 | pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((aligned(PAGE_SIZE))); |
| 21 | struct kmem_cache *pgd_cache; | ||
| 22 | 22 | ||
| 23 | pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) | 23 | pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) |
| 24 | { | 24 | { |
| @@ -100,7 +100,7 @@ static inline void pgd_list_del(pgd_t *pgd) | |||
| 100 | set_page_private(next, (unsigned long) pprev); | 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 | unsigned long flags; | 105 | unsigned long flags; |
| 106 | 106 | ||
| @@ -120,7 +120,7 @@ void pgd_ctor(void *pgd, struct kmem_cache *cache, unsigned long unused) | |||
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | /* never called when PTRS_PER_PMD > 1 */ | 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 | unsigned long flags; /* can be called from interrupt context */ | 125 | unsigned long flags; /* can be called from interrupt context */ |
| 126 | 126 | ||
| @@ -133,7 +133,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm) | |||
| 133 | { | 133 | { |
| 134 | pgd_t *pgd; | 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 | if (!pgd) | 137 | if (!pgd) |
| 138 | return pgd; | 138 | return pgd; |
| 139 | 139 | ||
| @@ -143,15 +143,15 @@ pgd_t *pgd_alloc(struct mm_struct *mm) | |||
| 143 | void pgd_free(pgd_t *pgd) | 143 | void pgd_free(pgd_t *pgd) |
| 144 | { | 144 | { |
| 145 | /* in the non-PAE case, clear_page_tables() clears user pgd entries */ | 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 | void __init pgtable_cache_init(void) | 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); | ||
| 157 | } | 151 | } |
| 152 | |||
| 153 | void check_pgt_cache(void) | ||
| 154 | { | ||
| 155 | quicklist_trim(0, pgd_dtor, 25, 16); | ||
| 156 | } | ||
| 157 | |||
diff --git a/include/asm-frv/tlb.h b/include/asm-frv/tlb.h index f94fe5cb9b3a..cd458eb6d75e 100644 --- a/include/asm-frv/tlb.h +++ b/include/asm-frv/tlb.h | |||
| @@ -3,7 +3,11 @@ | |||
| 3 | 3 | ||
| 4 | #include <asm/tlbflush.h> | 4 | #include <asm/tlbflush.h> |
| 5 | 5 | ||
| 6 | #ifdef CONFIG_MMU | ||
| 7 | extern void check_pgt_cache(void); | ||
| 8 | #else | ||
| 6 | #define check_pgt_cache() do {} while(0) | 9 | #define check_pgt_cache() do {} while(0) |
| 10 | #endif | ||
| 7 | 11 | ||
| 8 | /* | 12 | /* |
| 9 | * we don't need any special per-pte or per-vma handling... | 13 | * we don't need any special per-pte or per-vma handling... |
