mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ning.a.zhang@intel.com
To: linux-kernel@vger.kernel.org
Cc: Zhang Ning <ning.a.zhang@intel.com>
Subject: [PATCH] init: no need to wait device probe
Date: Thu, 15 Mar 2018 15:20:29 +0800	[thread overview]
Message-ID: <20180315072029.11441-1-ning.a.zhang@intel.com> (raw)

From: Zhang Ning <ning.a.zhang@intel.com>

there are 2 reasons for no need to wait device probe

reason 1:
mount root device is very late in kernel initial stage.
all initcalls are finished. that means most of probe functions
are returned.

and deferred probe are also finished by late_initcall.
only async probe driver are possible in  probing.

no block devices, device-mapper or nfs are use async probe.
so no need to wait device probe.

reason 2:
let's check dd.c, probe_count is increased and decreased only
in really_probe, and when really_probe returns, probe_count
always be 0.

when someone really wants to wait device-B probe.
but code looks like:

thread-1:			thread-2:
probe device-A;                 wait_for_device_probe();
msleep(30);
probe device-B

when device-A probe finishes, thread-2 will be wakeup,
but device-B is not probed.

wait_for_device_probe can't make sure the device you want is probed.

based on above 2 reasons, no need to wait for device probe.

Signed-off-by: Zhang Ning <ning.a.zhang@intel.com>
---
 init/do_mounts.c    | 9 ---------
 init/do_mounts_md.c | 2 --
 2 files changed, 11 deletions(-)

diff --git a/init/do_mounts.c b/init/do_mounts.c
index 7cf4f6dafd5f..a9fb2ad44964 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -555,15 +555,6 @@ void __init prepare_namespace(void)
 		ssleep(root_delay);
 	}
 
-	/*
-	 * wait for the known devices to complete their probing
-	 *
-	 * Note: this is a potential source of long boot delays.
-	 * For example, it is not atypical to wait 5 seconds here
-	 * for the touchpad of a laptop to initialize.
-	 */
-	wait_for_device_probe();
-
 	md_run_setup();
 
 	if (saved_root_name[0]) {
diff --git a/init/do_mounts_md.c b/init/do_mounts_md.c
index 3f733c760a8c..4aab3492e71d 100644
--- a/init/do_mounts_md.c
+++ b/init/do_mounts_md.c
@@ -292,8 +292,6 @@ static void __init autodetect_raid(void)
 	printk(KERN_INFO "md: Waiting for all devices to be available before autodetect\n");
 	printk(KERN_INFO "md: If you don't use raid, use raid=noautodetect\n");
 
-	wait_for_device_probe();
-
 	fd = sys_open("/dev/md0", 0, 0);
 	if (fd >= 0) {
 		sys_ioctl(fd, RAID_AUTORUN, raid_autopart);
-- 
2.14.2

             reply	other threads:[~2018-03-15  7:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-15  7:20 ning.a.zhang [this message]
2018-03-17 19:17 ` Randy Dunlap
2018-03-19  1:48   ` Zhang, Ning A
2018-03-19  2:55 ning.a.zhang

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=20180315072029.11441-1-ning.a.zhang@intel.com \
    --to=ning.a.zhang@intel.com \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome