All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] init/do_mounts.c: replace polling for root device with devtmpfs_wait_for_dev
@ 2009-06-10 14:28 tom.leiming
  2009-06-10 15:28 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: tom.leiming @ 2009-06-10 14:28 UTC (permalink / raw)
  To: greg; +Cc: linux-kernel, kay.sievers, akpm, Ming Lei

From: Ming Lei <tom.leiming@gmail.com>

This patch removes the polling for root device if rootwait parameter is
passed to kernel and CONFIG_DEVTMPFS is enabled. This way can lead to
a faster boot, especially booting from some asynchronous block device
(such as usb mass storage, mmc card, ...)

The patch has been verified in beagle board(mmc card as root device).

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
 init/do_mounts.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/init/do_mounts.c b/init/do_mounts.c
index aa56007..fcf3844 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -364,6 +364,7 @@ void __init mount_root(void)
 void __init prepare_namespace(void)
 {
 	int is_floppy;
+	int ret;
 
 	if (root_delay) {
 		printk(KERN_INFO "Waiting %dsec before mounting root device...\n",
@@ -371,6 +372,7 @@ void __init prepare_namespace(void)
 		ssleep(root_delay);
 	}
 
+#ifndef CONFIG_DEVTMPFS
 	/*
 	 * wait for the known devices to complete their probing
 	 *
@@ -379,6 +381,7 @@ void __init prepare_namespace(void)
 	 * for the touchpad of a laptop to initialize.
 	 */
 	wait_for_device_probe();
+#endif
 
 	md_run_setup();
 
@@ -397,6 +400,7 @@ void __init prepare_namespace(void)
 	if (initrd_load())
 		goto out;
 
+#ifndef CONFIG_DEVTMPFS
 	/* wait for any asynchronous scanning to complete */
 	if ((ROOT_DEV == 0) && root_wait) {
 		printk(KERN_INFO "Waiting for root device %s...\n",
@@ -406,6 +410,18 @@ void __init prepare_namespace(void)
 			msleep(100);
 		async_synchronize_full();
 	}
+#else
+	/*wait for root device, and expire if 120 seconds elapse*/
+	if (!strncmp(saved_root_name, "/dev/", 5)) {
+		ret = devtmpfs_wait_for_dev(saved_root_name, 120);
+		printk(KERN_INFO "wait for %s based on devtmpfs:%d\n",
+			saved_root_name, ret);
+	}
+
+	ROOT_DEV = name_to_dev_t(saved_root_name);
+	if (!ROOT_DEV)
+		printk(KERN_ERR "Root device %s not found!\n", saved_root_name);
+#endif
 
 	is_floppy = MAJOR(ROOT_DEV) == FLOPPY_MAJOR;
 
-- 
1.6.0.GIT


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

* Re: [PATCH 2/2] init/do_mounts.c: replace polling for root device with devtmpfs_wait_for_dev
  2009-06-10 14:28 [PATCH 2/2] init/do_mounts.c: replace polling for root device with devtmpfs_wait_for_dev tom.leiming
@ 2009-06-10 15:28 ` Christoph Hellwig
  2009-06-10 15:37   ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2009-06-10 15:28 UTC (permalink / raw)
  To: tom.leiming; +Cc: greg, linux-kernel, kay.sievers, akpm

On Wed, Jun 10, 2009 at 10:28:17PM +0800, tom.leiming@gmail.com wrote:
> From: Ming Lei <tom.leiming@gmail.com>
> 
> This patch removes the polling for root device if rootwait parameter is
> passed to kernel and CONFIG_DEVTMPFS is enabled. This way can lead to
> a faster boot, especially booting from some asynchronous block device
> (such as usb mass storage, mmc card, ...)
> 
> The patch has been verified in beagle board(mmc card as root device).

What tree did you find with devtmpfs in it?  It was pretty clearly
rejected when it came up.


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

* Re: [PATCH 2/2] init/do_mounts.c: replace polling for root device with devtmpfs_wait_for_dev
  2009-06-10 15:28 ` Christoph Hellwig
@ 2009-06-10 15:37   ` Alan Cox
  2009-06-10 22:49     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Cox @ 2009-06-10 15:37 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: tom.leiming, greg, linux-kernel, kay.sievers, akpm

> What tree did you find with devtmpfs in it?  It was pretty clearly
> rejected when it came up.

For some reason its still in -next

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

* Re: [PATCH 2/2] init/do_mounts.c: replace polling for root device with devtmpfs_wait_for_dev
  2009-06-10 15:37   ` Alan Cox
@ 2009-06-10 22:49     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2009-06-10 22:49 UTC (permalink / raw)
  To: Alan Cox; +Cc: Christoph Hellwig, tom.leiming, linux-kernel, kay.sievers, akpm

On Wed, Jun 10, 2009 at 04:37:12PM +0100, Alan Cox wrote:
> > What tree did you find with devtmpfs in it?  It was pretty clearly
> > rejected when it came up.
> 
> For some reason its still in -next

Yes, it's still in -next, sorry, I just realized this, as it's in my
driver-core tree.  We will be resubmitting it for .32 later on.
Discussion will happen after the .31 merge window is over.

thanks,

greg k-h

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-10 14:28 [PATCH 2/2] init/do_mounts.c: replace polling for root device with devtmpfs_wait_for_dev tom.leiming
2009-06-10 15:28 ` Christoph Hellwig
2009-06-10 15:37   ` Alan Cox
2009-06-10 22:49     ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.