linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] vmalloc: use kzalloc() instead of alloc_bootmem()
@ 2009-06-10 17:58 Pekka J Enberg
  2009-06-10 18:59 ` Linus Torvalds
  0 siblings, 1 reply; 2+ messages in thread
From: Pekka J Enberg @ 2009-06-10 17:58 UTC (permalink / raw)
  To: linux-kernel, linux-mm; +Cc: cl, mingo, hannes, torvalds, mpm, npiggin, yinghai

From: Pekka Enberg <penberg@cs.helsinki.fi>

We can call vmalloc_init() after kmem_cache_init() and use kzalloc() instead of
the bootmem allocator when initializing vmalloc data structures.

Acked-by: Nick Piggin <npiggin@suse.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---
 init/main.c  |    2 +-
 mm/vmalloc.c |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/init/main.c b/init/main.c
index 8be5193..0c6f366 100644
--- a/init/main.c
+++ b/init/main.c
@@ -587,13 +587,13 @@ asmlinkage void __init start_kernel(void)
 	 * kmem_cache_init()
 	 */
 	pidhash_init();
-	vmalloc_init();
 	vfs_caches_init_early();
 	/*
 	 * Set up kernel memory allocators
 	 */
 	mem_init();
 	kmem_cache_init();
+	vmalloc_init();
 	/*
 	 * Set up the scheduler prior starting any interrupts (such as the
 	 * timer interrupt). Full topology setup happens at smp_init()
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 083716e..3235138 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -23,7 +23,6 @@
 #include <linux/rbtree.h>
 #include <linux/radix-tree.h>
 #include <linux/rcupdate.h>
-#include <linux/bootmem.h>
 #include <linux/pfn.h>
 
 #include <asm/atomic.h>
@@ -1032,7 +1031,7 @@ void __init vmalloc_init(void)
 
 	/* Import existing vmlist entries. */
 	for (tmp = vmlist; tmp; tmp = tmp->next) {
-		va = alloc_bootmem(sizeof(struct vmap_area));
+		va = kzalloc(sizeof(struct vmap_area), GFP_NOWAIT);
 		va->flags = tmp->flags | VM_VM_AREA;
 		va->va_start = (unsigned long)tmp->addr;
 		va->va_end = va->va_start + tmp->size;
-- 
1.6.0.4

--
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] 2+ messages in thread

* Re: [PATCH 3/3] vmalloc: use kzalloc() instead of alloc_bootmem()
  2009-06-10 17:58 [PATCH 3/3] vmalloc: use kzalloc() instead of alloc_bootmem() Pekka J Enberg
@ 2009-06-10 18:59 ` Linus Torvalds
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Torvalds @ 2009-06-10 18:59 UTC (permalink / raw)
  To: Pekka J Enberg
  Cc: linux-kernel, linux-mm, cl, mingo, hannes, mpm, npiggin, yinghai



ACK on the whole series. Feel free to push it to me asap, so that we can 
get any potential issues found and sorted out early.

		Linus

--
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] 2+ messages in thread

end of thread, other threads:[~2009-06-10 19:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-10 17:58 [PATCH 3/3] vmalloc: use kzalloc() instead of alloc_bootmem() Pekka J Enberg
2009-06-10 18:59 ` Linus Torvalds

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