linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Get FRV to be able to run SLUB
@ 2007-05-08  3:41 Christoph Lameter
  2007-05-08 10:31 ` David Howells
  0 siblings, 1 reply; 11+ messages in thread
From: Christoph Lameter @ 2007-05-08  3:41 UTC (permalink / raw)
  To: David Howells; +Cc: linux-mm, akpm

Is FRV still alive? I see myself there as one of the last people who 
changes something. FRV seems to be not able to run SLUB because it 
modifies the page struct of page sized SLABS that it allocates. Its the 
last architecture that has trouble with SLUB I guess.

I fixed up the i386 patch for FRV. Could you or someone familiar with FRV 
give this a spin?


Subject: [FRV] Band-Aid: Minimal patch to enable SLUB

This patch switches the pgd handling to use a quicklist. That way
both are disentangled and SLUB works.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: linux-2.6.21-mm1/arch/frv/Kconfig
===================================================================
--- linux-2.6.21-mm1.orig/arch/frv/Kconfig	2007-05-07 20:22:50.000000000 -0700
+++ linux-2.6.21-mm1/arch/frv/Kconfig	2007-05-07 20:29:02.000000000 -0700
@@ -45,15 +45,15 @@ config TIME_LOW_RES
 	bool
 	default y
 
-config ARCH_HAS_ILOG2_U32
+config QUICKLIST
 	bool
 	default y
 
-config ARCH_HAS_ILOG2_U64
+config ARCH_HAS_ILOG2_U32
 	bool
 	default y
 
-config ARCH_USES_SLAB_PAGE_STRUCT
+config ARCH_HAS_ILOG2_U64
 	bool
 	default y
 
Index: linux-2.6.21-mm1/arch/frv/kernel/process.c
===================================================================
--- linux-2.6.21-mm1.orig/arch/frv/kernel/process.c	2007-05-07 20:22:50.000000000 -0700
+++ linux-2.6.21-mm1/arch/frv/kernel/process.c	2007-05-07 20:29:34.000000000 -0700
@@ -88,6 +88,8 @@ void cpu_idle(void)
 		while (!need_resched()) {
 			irq_stat[cpu].idle_timestamp = jiffies;
 
+			check_pgt_cache();
+
 			if (!frv_dma_inprogress && idle)
 				idle();
 		}
Index: linux-2.6.21-mm1/arch/frv/mm/pgalloc.c
===================================================================
--- linux-2.6.21-mm1.orig/arch/frv/mm/pgalloc.c	2007-05-07 20:24:47.000000000 -0700
+++ linux-2.6.21-mm1/arch/frv/mm/pgalloc.c	2007-05-07 20:34:58.000000000 -0700
@@ -18,7 +18,6 @@
 #include <asm/cacheflush.h>
 
 pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((aligned(PAGE_SIZE)));
-struct kmem_cache *pgd_cache;
 
 pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
 {
@@ -100,7 +99,7 @@ static inline void pgd_list_del(pgd_t *p
 		set_page_private(next, (unsigned long) pprev);
 }
 
-void pgd_ctor(void *pgd, struct kmem_cache *cache, unsigned long unused)
+void pgd_ctor(void *pgd)
 {
 	unsigned long flags;
 
@@ -120,7 +119,7 @@ void pgd_ctor(void *pgd, struct kmem_cac
 }
 
 /* never called when PTRS_PER_PMD > 1 */
-void pgd_dtor(void *pgd, struct kmem_cache *cache, unsigned long unused)
+void pgd_dtor(void *pgd)
 {
 	unsigned long flags; /* can be called from interrupt context */
 
@@ -133,7 +132,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
 {
 	pgd_t *pgd;
 
-	pgd = kmem_cache_alloc(pgd_cache, GFP_KERNEL);
+	pgd = quicklist_alloc(0, GFP_KERNEL, pgd_ctor);
 	if (!pgd)
 		return pgd;
 
@@ -143,15 +142,14 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
 void pgd_free(pgd_t *pgd)
 {
 	/* in the non-PAE case, clear_page_tables() clears user pgd entries */
-	kmem_cache_free(pgd_cache, pgd);
+	pgd = quicklist_free(0, NULL, pgd_dtor);
 }
 
 void __init pgtable_cache_init(void)
 {
-	pgd_cache = kmem_cache_create("pgd",
-				      PTRS_PER_PGD * sizeof(pgd_t),
-				      PTRS_PER_PGD * sizeof(pgd_t),
-				      SLAB_PANIC,
-				      pgd_ctor,
-				      pgd_dtor);
+}
+
+void check_pgt_cache(void)
+{
+	quicklist_trim(0, pgd_dtor, 25, 16);
 }
Index: linux-2.6.21-mm1/include/asm-frv/tlb.h
===================================================================
--- linux-2.6.21-mm1.orig/include/asm-frv/tlb.h	2007-05-07 20:30:26.000000000 -0700
+++ linux-2.6.21-mm1/include/asm-frv/tlb.h	2007-05-07 20:30:48.000000000 -0700
@@ -3,7 +3,7 @@
 
 #include <asm/tlbflush.h>
 
-#define check_pgt_cache() do {} while(0)
+extern void check_pgt_cache();
 
 /*
  * we don't need any special per-pte or per-vma handling...

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Get FRV to be able to run SLUB
  2007-05-08  3:41 Get FRV to be able to run SLUB Christoph Lameter
@ 2007-05-08 10:31 ` David Howells
  2007-05-08 11:59   ` Paul Mundt
                     ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: David Howells @ 2007-05-08 10:31 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: linux-mm, akpm

Christoph Lameter <clameter@sgi.com> wrote:

> Is FRV still alive? I see myself there as one of the last people who 
> changes something.

Yes.  That's because most of the patches I make and test on FRV are actually
not in the arch/ directory, but rather the mm/ directory.

> +			check_pgt_cache();
> +

But you didn't include the header file.

> +extern void check_pgt_cache();

Firstly, that should be ANSI, secondly that now breaks in NOMMU mode.

> +	pgd = quicklist_alloc(0, GFP_KERNEL, pgd_ctor);

Missing header file inclusion.

> +	pgd = quicklist_free(0, NULL, pgd_dtor);

That function is void, and is should be passed pgd or something, but I'm not
sure what.  No other arch seems to use this.

I further note that you've added a new interface and failed to document it.
There are no kdoc comments, and grep turns up nothing in the Documentation
directory.  Please fix this if you haven't already.

I've added a mostly revised patch, but it still doesn't compile:

David

diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index eed6943..114738a 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -45,15 +45,15 @@ config TIME_LOW_RES
 	bool
 	default y
 
-config ARCH_HAS_ILOG2_U32
+config QUICKLIST
 	bool
 	default y
 
-config ARCH_HAS_ILOG2_U64
+config ARCH_HAS_ILOG2_U32
 	bool
 	default y
 
-config ARCH_USES_SLAB_PAGE_STRUCT
+config ARCH_HAS_ILOG2_U64
 	bool
 	default y
 
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c
index 515a5ce..9583a33 100644
--- a/arch/frv/kernel/process.c
+++ b/arch/frv/kernel/process.c
@@ -25,12 +25,14 @@
 #include <linux/elf.h>
 #include <linux/reboot.h>
 #include <linux/interrupt.h>
+#include <linux/pagemap.h>
 
 #include <asm/asm-offsets.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/setup.h>
 #include <asm/pgtable.h>
+#include <asm/tlb.h>
 #include <asm/gdb-stub.h>
 #include <asm/mb-regs.h>
 
@@ -88,6 +90,8 @@ void cpu_idle(void)
 		while (!need_resched()) {
 			irq_stat[cpu].idle_timestamp = jiffies;
 
+			check_pgt_cache();
+
 			if (!frv_dma_inprogress && idle)
 				idle();
 		}
diff --git a/arch/frv/mm/pgalloc.c b/arch/frv/mm/pgalloc.c
index 19b13be..6027761 100644
--- a/arch/frv/mm/pgalloc.c
+++ b/arch/frv/mm/pgalloc.c
@@ -13,12 +13,12 @@
 #include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/highmem.h>
+#include <linux/quicklist.h>
 #include <asm/pgalloc.h>
 #include <asm/page.h>
 #include <asm/cacheflush.h>
 
 pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((aligned(PAGE_SIZE)));
-struct kmem_cache *pgd_cache;
 
 pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
 {
@@ -100,7 +100,7 @@ static inline void pgd_list_del(pgd_t *pgd)
 		set_page_private(next, (unsigned long) pprev);
 }
 
-void pgd_ctor(void *pgd, struct kmem_cache *cache, unsigned long unused)
+void pgd_ctor(void *pgd)
 {
 	unsigned long flags;
 
@@ -120,7 +120,7 @@ void pgd_ctor(void *pgd, struct kmem_cache *cache, unsigned long unused)
 }
 
 /* never called when PTRS_PER_PMD > 1 */
-void pgd_dtor(void *pgd, struct kmem_cache *cache, unsigned long unused)
+void pgd_dtor(void *pgd)
 {
 	unsigned long flags; /* can be called from interrupt context */
 
@@ -133,7 +133,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
 {
 	pgd_t *pgd;
 
-	pgd = kmem_cache_alloc(pgd_cache, GFP_KERNEL);
+	pgd = quicklist_alloc(0, GFP_KERNEL, pgd_ctor);
 	if (!pgd)
 		return pgd;
 
@@ -142,18 +142,15 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
 
 void pgd_free(pgd_t *pgd)
 {
-	/* in the non-PAE case, clear_page_tables() clears user pgd entries */
-	kmem_cache_free(pgd_cache, pgd);
+  	/* in the non-PAE case, clear_page_tables() clears user pgd entries */
+	pgd = quicklist_free(0, NULL, pgd_dtor);
 }
 
 void __init pgtable_cache_init(void)
 {
-	pgd_cache = kmem_cache_create("pgd",
-				      PTRS_PER_PGD * sizeof(pgd_t),
-				      PTRS_PER_PGD * sizeof(pgd_t),
-				      0,
-				      pgd_ctor,
-				      pgd_dtor);
-	if (!pgd_cache)
-		panic("pgtable_cache_init(): Cannot create pgd cache");
+}
+
+void check_pgt_cache(void)
+{
+	quicklist_trim(0, pgd_dtor, 25, 16);
 }
diff --git a/include/asm-frv/tlb.h b/include/asm-frv/tlb.h
index f94fe5c..cd458eb 100644
--- a/include/asm-frv/tlb.h
+++ b/include/asm-frv/tlb.h
@@ -3,7 +3,11 @@
 
 #include <asm/tlbflush.h>
 
+#ifdef CONFIG_MMU
+extern void check_pgt_cache(void);
+#else
 #define check_pgt_cache() do {} while(0)
+#endif
 
 /*
  * we don't need any special per-pte or per-vma handling...

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Get FRV to be able to run SLUB
  2007-05-08 10:31 ` David Howells
@ 2007-05-08 11:59   ` Paul Mundt
  2007-05-08 12:04   ` David Howells
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Paul Mundt @ 2007-05-08 11:59 UTC (permalink / raw)
  To: David Howells; +Cc: Christoph Lameter, linux-mm, akpm

On Tue, May 08, 2007 at 11:31:49AM +0100, David Howells wrote:
> Christoph Lameter <clameter@sgi.com> wrote:
> Missing header file inclusion.
> 
> > +	pgd = quicklist_free(0, NULL, pgd_dtor);
> 
> That function is void, and is should be passed pgd or something, but I'm not
> sure what.  No other arch seems to use this.
> 
sparc64 uses it now, and others are moving over to it gradually (I just
converted SH earlier). pgd_free() should be:

	quicklist_free(0, pgd_dtor, pgd);

in this case.

include/linux/quicklist.h isn't exactly lacking for documentation.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Get FRV to be able to run SLUB
  2007-05-08 10:31 ` David Howells
  2007-05-08 11:59   ` Paul Mundt
@ 2007-05-08 12:04   ` David Howells
  2007-05-08 16:05   ` Christoph Lameter
  2007-05-08 18:02   ` David Howells
  3 siblings, 0 replies; 11+ messages in thread
From: David Howells @ 2007-05-08 12:04 UTC (permalink / raw)
  To: Paul Mundt; +Cc: Christoph Lameter, linux-mm, akpm

Paul Mundt <lethal@linux-sh.org> wrote:

> > That function is void, and is should be passed pgd or something, but I'm not
> > sure what.  No other arch seems to use this.
> > 
> sparc64 uses it now, and others are moving over to it gradually (I just
> converted SH earlier).

Yeah...  I found that after I'd sent the message.  The usage is in the header
files not the arch/ dir.

David

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Get FRV to be able to run SLUB
  2007-05-08 10:31 ` David Howells
  2007-05-08 11:59   ` Paul Mundt
  2007-05-08 12:04   ` David Howells
@ 2007-05-08 16:05   ` Christoph Lameter
  2007-05-08 18:02   ` David Howells
  3 siblings, 0 replies; 11+ messages in thread
From: Christoph Lameter @ 2007-05-08 16:05 UTC (permalink / raw)
  To: David Howells; +Cc: linux-mm, akpm

On Tue, 8 May 2007, David Howells wrote:

> I've added a mostly revised patch, but it still doesn't compile:

How does it fail?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Get FRV to be able to run SLUB
  2007-05-08 10:31 ` David Howells
                     ` (2 preceding siblings ...)
  2007-05-08 16:05   ` Christoph Lameter
@ 2007-05-08 18:02   ` David Howells
  2007-05-08 18:07     ` Christoph Lameter
  2007-05-08 19:52     ` David Howells
  3 siblings, 2 replies; 11+ messages in thread
From: David Howells @ 2007-05-08 18:02 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: linux-mm, akpm

Christoph Lameter <clameter@sgi.com> wrote:

> > I've added a mostly revised patch, but it still doesn't compile:
> 
> How does it fail?

pgd_free() is still wrong.

David

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Get FRV to be able to run SLUB
  2007-05-08 18:02   ` David Howells
@ 2007-05-08 18:07     ` Christoph Lameter
  2007-05-08 19:52     ` David Howells
  1 sibling, 0 replies; 11+ messages in thread
From: Christoph Lameter @ 2007-05-08 18:07 UTC (permalink / raw)
  To: David Howells; +Cc: linux-mm, akpm

On Tue, 8 May 2007, David Howells wrote:

> Christoph Lameter <clameter@sgi.com> wrote:
> 
> > > I've added a mostly revised patch, but it still doesn't compile:
> > 
> > How does it fail?
> 
> pgd_free() is still wrong.

Yea but Paul Mundt figured out the problem in the parameters. So does it 
work now?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Get FRV to be able to run SLUB
  2007-05-08 18:02   ` David Howells
  2007-05-08 18:07     ` Christoph Lameter
@ 2007-05-08 19:52     ` David Howells
  2007-05-08 20:28       ` Christoph Lameter
                         ` (2 more replies)
  1 sibling, 3 replies; 11+ messages in thread
From: David Howells @ 2007-05-08 19:52 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: linux-mm, akpm

Christoph Lameter <clameter@sgi.com> wrote:

> Yea but Paul Mundt figured out the problem in the parameters. So does it 
> work now?

Yes, it seems to.  Please, please document the quicklist stuff properly.  I'll
review your documentation if you want.

David

diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index eed6943..114738a 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -45,15 +45,15 @@ config TIME_LOW_RES
 	bool
 	default y
 
-config ARCH_HAS_ILOG2_U32
+config QUICKLIST
 	bool
 	default y
 
-config ARCH_HAS_ILOG2_U64
+config ARCH_HAS_ILOG2_U32
 	bool
 	default y
 
-config ARCH_USES_SLAB_PAGE_STRUCT
+config ARCH_HAS_ILOG2_U64
 	bool
 	default y
 
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c
index 515a5ce..9583a33 100644
--- a/arch/frv/kernel/process.c
+++ b/arch/frv/kernel/process.c
@@ -25,12 +25,14 @@
 #include <linux/elf.h>
 #include <linux/reboot.h>
 #include <linux/interrupt.h>
+#include <linux/pagemap.h>
 
 #include <asm/asm-offsets.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/setup.h>
 #include <asm/pgtable.h>
+#include <asm/tlb.h>
 #include <asm/gdb-stub.h>
 #include <asm/mb-regs.h>
 
@@ -88,6 +90,8 @@ void cpu_idle(void)
 		while (!need_resched()) {
 			irq_stat[cpu].idle_timestamp = jiffies;
 
+			check_pgt_cache();
+
 			if (!frv_dma_inprogress && idle)
 				idle();
 		}
diff --git a/arch/frv/mm/pgalloc.c b/arch/frv/mm/pgalloc.c
index 19b13be..807040c 100644
--- a/arch/frv/mm/pgalloc.c
+++ b/arch/frv/mm/pgalloc.c
@@ -13,12 +13,12 @@
 #include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/highmem.h>
+#include <linux/quicklist.h>
 #include <asm/pgalloc.h>
 #include <asm/page.h>
 #include <asm/cacheflush.h>
 
 pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((aligned(PAGE_SIZE)));
-struct kmem_cache *pgd_cache;
 
 pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
 {
@@ -100,7 +100,7 @@ static inline void pgd_list_del(pgd_t *pgd)
 		set_page_private(next, (unsigned long) pprev);
 }
 
-void pgd_ctor(void *pgd, struct kmem_cache *cache, unsigned long unused)
+void pgd_ctor(void *pgd)
 {
 	unsigned long flags;
 
@@ -120,7 +120,7 @@ void pgd_ctor(void *pgd, struct kmem_cache *cache, unsigned long unused)
 }
 
 /* never called when PTRS_PER_PMD > 1 */
-void pgd_dtor(void *pgd, struct kmem_cache *cache, unsigned long unused)
+void pgd_dtor(void *pgd)
 {
 	unsigned long flags; /* can be called from interrupt context */
 
@@ -133,7 +133,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
 {
 	pgd_t *pgd;
 
-	pgd = kmem_cache_alloc(pgd_cache, GFP_KERNEL);
+	pgd = quicklist_alloc(0, GFP_KERNEL, pgd_ctor);
 	if (!pgd)
 		return pgd;
 
@@ -142,18 +142,14 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
 
 void pgd_free(pgd_t *pgd)
 {
-	/* in the non-PAE case, clear_page_tables() clears user pgd entries */
-	kmem_cache_free(pgd_cache, pgd);
+	quicklist_free(0, pgd_dtor, pgd);
 }
 
 void __init pgtable_cache_init(void)
 {
-	pgd_cache = kmem_cache_create("pgd",
-				      PTRS_PER_PGD * sizeof(pgd_t),
-				      PTRS_PER_PGD * sizeof(pgd_t),
-				      0,
-				      pgd_ctor,
-				      pgd_dtor);
-	if (!pgd_cache)
-		panic("pgtable_cache_init(): Cannot create pgd cache");
+}
+
+void check_pgt_cache(void)
+{
+	quicklist_trim(0, pgd_dtor, 25, 16);
 }
diff --git a/include/asm-frv/tlb.h b/include/asm-frv/tlb.h
index f94fe5c..cd458eb 100644
--- a/include/asm-frv/tlb.h
+++ b/include/asm-frv/tlb.h
@@ -3,7 +3,11 @@
 
 #include <asm/tlbflush.h>
 
+#ifdef CONFIG_MMU
+extern void check_pgt_cache(void);
+#else
 #define check_pgt_cache() do {} while(0)
+#endif
 
 /*
  * we don't need any special per-pte or per-vma handling...

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Get FRV to be able to run SLUB
  2007-05-08 19:52     ` David Howells
@ 2007-05-08 20:28       ` Christoph Lameter
  2007-05-08 20:33       ` Christoph Lameter
  2007-05-09  9:23       ` David Howells
  2 siblings, 0 replies; 11+ messages in thread
From: Christoph Lameter @ 2007-05-08 20:28 UTC (permalink / raw)
  To: David Howells; +Cc: linux-mm, akpm

I fixed up the patch to work against 2.6.21-mm1. I added your signoff.

Ok to apply to Andrew's tree? Or will this patch go through the arch 
maintainer?


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>

Index: linux-2.6.21-mm1/arch/frv/Kconfig
===================================================================
--- linux-2.6.21-mm1.orig/arch/frv/Kconfig	2007-05-08 13:14:44.000000000 -0700
+++ linux-2.6.21-mm1/arch/frv/Kconfig	2007-05-08 13:15:52.000000000 -0700
@@ -45,15 +45,15 @@ config TIME_LOW_RES
 	bool
 	default y
 
-config ARCH_HAS_ILOG2_U32
+config QUICKLIST
 	bool
 	default y
 
-config ARCH_HAS_ILOG2_U64
+config ARCH_HAS_ILOG2_U32
 	bool
 	default y
 
-config ARCH_USES_SLAB_PAGE_STRUCT
+config ARCH_HAS_ILOG2_U64
 	bool
 	default y
 
Index: linux-2.6.21-mm1/arch/frv/kernel/process.c
===================================================================
--- linux-2.6.21-mm1.orig/arch/frv/kernel/process.c	2007-05-08 13:14:44.000000000 -0700
+++ linux-2.6.21-mm1/arch/frv/kernel/process.c	2007-05-08 13:15:52.000000000 -0700
@@ -25,12 +25,14 @@
 #include <linux/elf.h>
 #include <linux/reboot.h>
 #include <linux/interrupt.h>
+#include <linux/pagemap.h>
 
 #include <asm/asm-offsets.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/setup.h>
 #include <asm/pgtable.h>
+#include <asm/tlb.h>
 #include <asm/gdb-stub.h>
 #include <asm/mb-regs.h>
 
@@ -88,6 +90,8 @@ void cpu_idle(void)
 		while (!need_resched()) {
 			irq_stat[cpu].idle_timestamp = jiffies;
 
+			check_pgt_cache();
+
 			if (!frv_dma_inprogress && idle)
 				idle();
 		}
Index: linux-2.6.21-mm1/arch/frv/mm/pgalloc.c
===================================================================
--- linux-2.6.21-mm1.orig/arch/frv/mm/pgalloc.c	2007-05-08 13:14:44.000000000 -0700
+++ linux-2.6.21-mm1/arch/frv/mm/pgalloc.c	2007-05-08 13:17:42.000000000 -0700
@@ -13,12 +13,12 @@
 #include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/highmem.h>
+#include <linux/quicklist.h>
 #include <asm/pgalloc.h>
 #include <asm/page.h>
 #include <asm/cacheflush.h>
 
 pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((aligned(PAGE_SIZE)));
-struct kmem_cache *pgd_cache;
 
 pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
 {
@@ -100,7 +100,7 @@ static inline void pgd_list_del(pgd_t *p
 		set_page_private(next, (unsigned long) pprev);
 }
 
-void pgd_ctor(void *pgd, struct kmem_cache *cache, unsigned long unused)
+void pgd_ctor(void *pgd)
 {
 	unsigned long flags;
 
@@ -120,7 +120,7 @@ void pgd_ctor(void *pgd, struct kmem_cac
 }
 
 /* never called when PTRS_PER_PMD > 1 */
-void pgd_dtor(void *pgd, struct kmem_cache *cache, unsigned long unused)
+void pgd_dtor(void *pgd)
 {
 	unsigned long flags; /* can be called from interrupt context */
 
@@ -133,7 +133,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
 {
 	pgd_t *pgd;
 
-	pgd = kmem_cache_alloc(pgd_cache, GFP_KERNEL);
+	pgd = quicklist_alloc(0, GFP_KERNEL, pgd_ctor);
 	if (!pgd)
 		return pgd;
 
@@ -143,15 +143,15 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
 void pgd_free(pgd_t *pgd)
 {
 	/* in the non-PAE case, clear_page_tables() clears user pgd entries */
-	kmem_cache_free(pgd_cache, pgd);
+ 	quicklist_free(0, pgd_dtor, pgd);
 }
 
 void __init pgtable_cache_init(void)
 {
-	pgd_cache = kmem_cache_create("pgd",
-				      PTRS_PER_PGD * sizeof(pgd_t),
-				      PTRS_PER_PGD * sizeof(pgd_t),
-				      SLAB_PANIC,
-				      pgd_ctor,
-				      pgd_dtor);
 }
+
+void check_pgt_cache(void)
+{
+	quicklist_trim(0, pgd_dtor, 25, 16);
+}
+
Index: linux-2.6.21-mm1/include/asm-frv/tlb.h
===================================================================
--- linux-2.6.21-mm1.orig/include/asm-frv/tlb.h	2007-05-08 13:14:44.000000000 -0700
+++ linux-2.6.21-mm1/include/asm-frv/tlb.h	2007-05-08 13:15:52.000000000 -0700
@@ -3,7 +3,11 @@
 
 #include <asm/tlbflush.h>
 
+#ifdef CONFIG_MMU
+extern void check_pgt_cache(void);
+#else
 #define check_pgt_cache() do {} while(0)
+#endif
 
 /*
  * we don't need any special per-pte or per-vma handling...

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Get FRV to be able to run SLUB
  2007-05-08 19:52     ` David Howells
  2007-05-08 20:28       ` Christoph Lameter
@ 2007-05-08 20:33       ` Christoph Lameter
  2007-05-09  9:23       ` David Howells
  2 siblings, 0 replies; 11+ messages in thread
From: Christoph Lameter @ 2007-05-08 20:33 UTC (permalink / raw)
  To: David Howells; +Cc: linux-mm, akpm

On Tue, 8 May 2007, David Howells wrote:

> Yes, it seems to.  Please, please document the quicklist stuff properly.  I'll
> review your documentation if you want.

I'd be glad if you did.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Get FRV to be able to run SLUB
  2007-05-08 19:52     ` David Howells
  2007-05-08 20:28       ` Christoph Lameter
  2007-05-08 20:33       ` Christoph Lameter
@ 2007-05-09  9:23       ` David Howells
  2 siblings, 0 replies; 11+ messages in thread
From: David Howells @ 2007-05-09  9:23 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: linux-mm, akpm

Christoph Lameter <clameter@sgi.com> wrote:

> I fixed up the patch to work against 2.6.21-mm1. I added your signoff.

That's fine.

> Ok to apply to Andrew's tree? Or will this patch go through the arch 
> maintainer?

I don't mind.

David

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-05-09  9:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-08  3:41 Get FRV to be able to run SLUB Christoph Lameter
2007-05-08 10:31 ` David Howells
2007-05-08 11:59   ` Paul Mundt
2007-05-08 12:04   ` David Howells
2007-05-08 16:05   ` Christoph Lameter
2007-05-08 18:02   ` David Howells
2007-05-08 18:07     ` Christoph Lameter
2007-05-08 19:52     ` David Howells
2007-05-08 20:28       ` Christoph Lameter
2007-05-08 20:33       ` Christoph Lameter
2007-05-09  9:23       ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox