public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] raid: make RAID autodetect default a KConfig option
@ 2008-09-21 22:45 Arjan van de Ven
  2008-09-22  8:27 ` Ingo Molnar
  0 siblings, 1 reply; 6+ messages in thread
From: Arjan van de Ven @ 2008-09-21 22:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: neilb, mingo, davej


>From 812bf9a448d96375a3aec5c51764d74cace85abb Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Sun, 21 Sep 2008 15:44:32 -0700
Subject: [PATCH] raid: make RAID autodetect default a KConfig option

RAID autodetect has the side effect of requiring synchronisation
of all device drivers, which can make the boot several seconds longer
(I've measured 7 on one of my laptops).... even for systems that don't
have RAID setup for the root filesystem (the only FS where this matters).

This patch makes the default for autodetect a config option; either way
the user can always override via the kernel command line.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
 drivers/md/Kconfig  |   14 ++++++++++++++
 init/do_mounts_md.c |   11 +++++++++--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/md/Kconfig b/drivers/md/Kconfig
index 07d92c1..8e72c91 100644
--- a/drivers/md/Kconfig
+++ b/drivers/md/Kconfig
@@ -30,6 +30,20 @@ config BLK_DEV_MD
 
 	  If unsure, say N.
 
+config MD_AUTODETECT
+	bool "Autodetect RAID arrays during kernel boot"
+	depends on BLK_DEV_MD
+	default y
+	---help---
+	  If you say Y here, then the kernel will try to autodetect raid
+	  arrays as part of its boot process. 
+
+	  If you don't use raid and say Y, this autodetection can cause 
+	  a several-second delay in the boot time due to various
+	  synchronisation steps that are part of this step.
+
+	  If unsure, say Y.
+
 config MD_LINEAR
 	tristate "Linear (append) mode"
 	depends on BLK_DEV_MD
diff --git a/init/do_mounts_md.c b/init/do_mounts_md.c
index c0dfd3c..48b3fad 100644
--- a/init/do_mounts_md.c
+++ b/init/do_mounts_md.c
@@ -12,7 +12,12 @@
  * The code for that is here.
  */
 
-static int __initdata raid_noautodetect, raid_autopart;
+#ifdef CONFIG_MD_AUTODETECT
+static int __initdata raid_noautodetect;
+#else
+static int __initdata raid_noautodetect=1;
+#endif
+static int __initdata raid_autopart;
 
 static struct {
 	int minor;
@@ -252,6 +257,8 @@ static int __init raid_setup(char *str)
 
 		if (!strncmp(str, "noautodetect", wlen))
 			raid_noautodetect = 1;
+		if (!strncmp(str, "autodetect", wlen))
+			raid_noautodetect = 0;
 		if (strncmp(str, "partitionable", wlen)==0)
 			raid_autopart = 1;
 		if (strncmp(str, "part", wlen)==0)
@@ -288,7 +295,7 @@ void __init md_run_setup(void)
 	create_dev("/dev/md0", MKDEV(MD_MAJOR, 0));
 
 	if (raid_noautodetect)
-		printk(KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=noautodetect)\n");
+		printk(KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=autodetect will force)\n");
 	else
 		autodetect_raid();
 	md_setup_drive();
-- 
1.5.5.1


-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

^ permalink raw reply related	[flat|nested] 6+ messages in thread
* Re: [PATCH] raid: make RAID autodetect default a KConfig option
@ 2008-09-23 15:37 Alan Jenkins
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Jenkins @ 2008-09-23 15:37 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: neilb, linux-kernel

I noticed this Configure option is present even if BLK_DEV_MD=m.  In
this case the option does nothing, which is inconsistent with the help
text and generally odd :-).

Would you change it?

------

Hide RAID autodetect option if MD is compiled as a module.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>

diff --git a/drivers/md/Configure b/drivers/md/Configure
index 8e72c91..2281b50 100644
--- a/drivers/md/Configure
+++ b/drivers/md/Configure
@@ -32,7 +32,7 @@ config BLK_DEV_MD
 
 config MD_AUTODETECT
 	bool "Autodetect RAID arrays during kernel boot"
-	depends on BLK_DEV_MD
+	depends on BLK_DEV_MD=y
 	default y
 	---help---
 	  If you say Y here, then the kernel will try to autodetect raid


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

end of thread, other threads:[~2008-09-23 15:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-21 22:45 [PATCH] raid: make RAID autodetect default a KConfig option Arjan van de Ven
2008-09-22  8:27 ` Ingo Molnar
2008-09-23  3:45   ` Neil Brown
2008-09-23  3:58     ` Arjan van de Ven
2008-09-23  9:15       ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2008-09-23 15:37 Alan Jenkins

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