lkml.org 
[lkml]   [2009]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] mm/init: cpu_hotplug_init() must be initialized before SLAB
From
Date
SLAB uses get/put_online_cpus() which use a mutex which is itself
only initialized when cpu_hotplug_init() is called. Currently
we hang suring boot in SLAB due to doing that too late. This
moves the call to cpu_hotplug_init() to before mm_init() (it
should be safe to call that early).

This fixes boot with SLAB on some PowerPC machines.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Sachin, James, do that fix the boot failures you've been seeing ?

Index: linux-work/init/main.c
===================================================================
--- linux-work.orig/init/main.c 2009-06-23 10:17:46.000000000 +1000
+++ linux-work/init/main.c 2009-06-23 10:20:30.000000000 +1000
@@ -608,7 +608,18 @@ asmlinkage void __init start_kernel(void
vfs_caches_init_early();
sort_main_extable();
trap_init();
+
+ /*
+ * This initializes the mutex used by get/put_online_cpus()
+ * which is used by SLAB
+ */
+ cpu_hotplug_init();
+
+ /*
+ * Initialize the page allocator, SL*B and vmalloc
+ */
mm_init();
+
/*
* Set up the scheduler prior starting any interrupts (such as the
* timer interrupt). Full topology setup happens at smp_init()
@@ -678,7 +689,6 @@ asmlinkage void __init start_kernel(void
#endif
page_cgroup_init();
enable_debug_pagealloc();
- cpu_hotplug_init();
kmemtrace_init();
kmemleak_init();
debug_objects_mem_init();



\
 
 \ /
  Last update: 2009-06-23 02:57    [from the cache]
©2003-2011 Jasper Spaans