Skip to content

Commit 8defab3

Browse files
Christoph LameterLinus Torvalds
authored andcommitted
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>
1 parent 3401388 commit 8defab3

4 files changed

Lines changed: 22 additions & 14 deletions

File tree

‎arch/frv/Kconfig‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ config TIME_LOW_RES
4545
bool
4646
default y
4747

48-
config ARCH_HAS_ILOG2_U32
48+
config QUICKLIST
4949
bool
5050
default y
5151

52-
config ARCH_HAS_ILOG2_U64
52+
config ARCH_HAS_ILOG2_U32
5353
bool
5454
default y
5555

56-
config ARCH_USES_SLAB_PAGE_STRUCT
56+
config ARCH_HAS_ILOG2_U64
5757
bool
5858
default y
5959

‎arch/frv/kernel/process.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@
2525
#include <linux/elf.h>
2626
#include <linux/reboot.h>
2727
#include <linux/interrupt.h>
28+
#include <linux/pagemap.h>
2829

2930
#include <asm/asm-offsets.h>
3031
#include <asm/uaccess.h>
3132
#include <asm/system.h>
3233
#include <asm/setup.h>
3334
#include <asm/pgtable.h>
35+
#include <asm/tlb.h>
3436
#include <asm/gdb-stub.h>
3537
#include <asm/mb-regs.h>
3638

@@ -88,6 +90,8 @@ void cpu_idle(void)
8890
while (!need_resched()) {
8991
irq_stat[cpu].idle_timestamp = jiffies;
9092

93+
check_pgt_cache();
94+
9195
if (!frv_dma_inprogress && idle)
9296
idle();
9397
}

‎arch/frv/mm/pgalloc.c‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
#include <linux/slab.h>
1414
#include <linux/mm.h>
1515
#include <linux/highmem.h>
16+
#include <linux/quicklist.h>
1617
#include <asm/pgalloc.h>
1718
#include <asm/page.h>
1819
#include <asm/cacheflush.h>
1920

2021
pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((aligned(PAGE_SIZE)));
21-
struct kmem_cache *pgd_cache;
2222

2323
pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
2424
{
@@ -100,7 +100,7 @@ static inline void pgd_list_del(pgd_t *pgd)
100100
set_page_private(next, (unsigned long) pprev);
101101
}
102102

103-
void pgd_ctor(void *pgd, struct kmem_cache *cache, unsigned long unused)
103+
void pgd_ctor(void *pgd)
104104
{
105105
unsigned long flags;
106106

@@ -120,7 +120,7 @@ void pgd_ctor(void *pgd, struct kmem_cache *cache, unsigned long unused)
120120
}
121121

122122
/* 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)
124124
{
125125
unsigned long flags; /* can be called from interrupt context */
126126

@@ -133,7 +133,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
133133
{
134134
pgd_t *pgd;
135135

136-
pgd = kmem_cache_alloc(pgd_cache, GFP_KERNEL);
136+
pgd = quicklist_alloc(0, GFP_KERNEL, pgd_ctor);
137137
if (!pgd)
138138
return pgd;
139139

@@ -143,15 +143,15 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
143143
void pgd_free(pgd_t *pgd)
144144
{
145145
/* 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);
147147
}
148148

149149
void __init pgtable_cache_init(void)
150150
{
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);
157151
}
152+
153+
void check_pgt_cache(void)
154+
{
155+
quicklist_trim(0, pgd_dtor, 25, 16);
156+
}
157+

‎include/asm-frv/tlb.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

44
#include <asm/tlbflush.h>
55

6+
#ifdef CONFIG_MMU
7+
extern void check_pgt_cache(void);
8+
#else
69
#define check_pgt_cache() do {} while(0)
10+
#endif
711

812
/*
913
* we don't need any special per-pte or per-vma handling...

0 commit comments

Comments
 (0)