Commit a364092a412975e506415f77f0628cbdd28c3913

Authored by Arjan van de Ven
1 parent 82cbc11a41

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>
Acked-by: NeilBrown <neilb@suse.de>

Showing 2 changed files with 23 additions and 2 deletions Side-by-side Diff

... ... @@ -30,6 +30,20 @@
30 30  
31 31 If unsure, say N.
32 32  
  33 +config MD_AUTODETECT
  34 + bool "Autodetect RAID arrays during kernel boot"
  35 + depends on BLK_DEV_MD
  36 + default y
  37 + ---help---
  38 + If you say Y here, then the kernel will try to autodetect raid
  39 + arrays as part of its boot process.
  40 +
  41 + If you don't use raid and say Y, this autodetection can cause
  42 + a several-second delay in the boot time due to various
  43 + synchronisation steps that are part of this step.
  44 +
  45 + If unsure, say Y.
  46 +
33 47 config MD_LINEAR
34 48 tristate "Linear (append) mode"
35 49 depends on BLK_DEV_MD
... ... @@ -12,7 +12,12 @@
12 12 * The code for that is here.
13 13 */
14 14  
15   -static int __initdata raid_noautodetect, raid_autopart;
  15 +#ifdef CONFIG_MD_AUTODETECT
  16 +static int __initdata raid_noautodetect;
  17 +#else
  18 +static int __initdata raid_noautodetect=1;
  19 +#endif
  20 +static int __initdata raid_autopart;
16 21  
17 22 static struct {
18 23 int minor;
... ... @@ -252,6 +257,8 @@
252 257  
253 258 if (!strncmp(str, "noautodetect", wlen))
254 259 raid_noautodetect = 1;
  260 + if (!strncmp(str, "autodetect", wlen))
  261 + raid_noautodetect = 0;
255 262 if (strncmp(str, "partitionable", wlen)==0)
256 263 raid_autopart = 1;
257 264 if (strncmp(str, "part", wlen)==0)
... ... @@ -288,7 +295,7 @@
288 295 create_dev("/dev/md0", MKDEV(MD_MAJOR, 0));
289 296  
290 297 if (raid_noautodetect)
291   - printk(KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=noautodetect)\n");
  298 + printk(KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=autodetect will force)\n");
292 299 else
293 300 autodetect_raid();
294 301 md_setup_drive();