public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Sachin Sant <sachinp@in.ibm.com>
Subject: [PATCH] mm/init: cpu_hotplug_init() must be initialized before SLAB
Date: Tue, 23 Jun 2009 10:31:29 +1000	[thread overview]
Message-ID: <1245717089.4017.18.camel@pasglop> (raw)

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();



             reply	other threads:[~2009-06-23  0:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-23  0:31 Benjamin Herrenschmidt [this message]
2009-06-23  1:13 ` [PATCH] mm/init: cpu_hotplug_init() must be initialized before SLAB James Bottomley
2009-06-23  2:29 ` Linus Torvalds
2009-06-23  2:59   ` Benjamin Herrenschmidt
2009-06-23  3:23   ` Benjamin Herrenschmidt
2009-06-23  3:26   ` Sachin Sant
2009-06-23  4:00   ` James Bottomley
2009-06-23  5:59   ` Pekka Enberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1245717089.4017.18.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=rjw@sisk.pl \
    --cc=sachinp@in.ibm.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox