aboutsummaryrefslogtreecommitdiffstats
path: root/arch/frv/mm/pgalloc.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-05-09 05:32:48 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-09 15:30:46 -0400
commit8defab33774a5c33920196a2ee9c0a946d22ba67 (patch)
tree6924e361156f6420c8c42aa614998e565096c6aa /arch/frv/mm/pgalloc.c
parent34013886ef47ea72e412beb04558431b57a68d51 (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>
Diffstat (limited to 'arch/frv/mm/pgalloc.c')
-rw-r--r--arch/frv/mm/pgalloc.c22
1 files changed, 11 insertions, 11 deletions
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
20pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((aligned(PAGE_SIZE))); 21pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((aligned(PAGE_SIZE)));
21struct kmem_cache *pgd_cache;
22 22
23pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) 23pte_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
103void pgd_ctor(void *pgd, struct kmem_cache *cache, unsigned long unused) 103void 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 */
123void pgd_dtor(void *pgd, struct kmem_cache *cache, unsigned long unused) 123void 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)
143void pgd_free(pgd_t *pgd) 143void 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
149void __init pgtable_cache_init(void) 149void __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
153void check_pgt_cache(void)
154{
155 quicklist_trim(0, pgd_dtor, 25, 16);
156}
157