From: Kay Sievers <kay.sievers@vrfy.org>
To: Patrick Mansfield <patmans@us.ibm.com>
Cc: Matthew Wilcox <matthew@wil.cx>,
linux-hotplug-devel@lists.sourceforge.net,
Stefan Richter <stefanr@s5r6.in-berlin.de>,
linux-scsi@vger.kernel.org
Subject: Re: Asynchronous scsi scanning, version 9
Date: Thu, 01 Jun 2006 12:22:12 +0000 [thread overview]
Message-ID: <1149164533.3419.38.camel@pim.off.vrfy.org> (raw)
In-Reply-To: <20060531232139.GA3202@us.ibm.com>
On Wed, 2006-05-31 at 16:21 -0700, Patrick Mansfield wrote:
> [adding hotplug-devel ... maybe Marco or Kay can comment]
>
> On Mon, May 29, 2006 at 07:05:15AM -0600, Matthew Wilcox wrote:
> > On Mon, May 29, 2006 at 10:38:13AM +0200, Stefan Richter wrote:
> > > Matthew Wilcox wrote:
> > > > Add the scsi_mod.scan kernel parameter to determine how scsi busses
> > > > are scanned. "sync" is the current behaviour. "none" punts scanning
> > > > scsi busses to userspace. "async" is the new default.
> > >
> > > This parameter is only relevant with LLDDs which use scsi_scan_host, right?
> >
> > Not entirely. If you set it to "none", scsi_scan_target() also returns
> > without doing anything. If you use the scsi_prep_async_scan() and
> > scsi_finish_async_scan() API, you can also use this infrastructure to
> > make scanning sbp2 synchronised with other scsi hosts. Then the setting
> > of sync vs async also triggers old vs new behaviour.
> >
> > > Furthermore, "sync|async" basically means "serialized|parallelized
> > > across host adapters". Does it also mean "finishing before|after driver
> > > initialization"? (With LLDDs which use scsi_scan_host.)
> >
> > That's what scsi_complete_async_scans() is for. If you have a built-in
> > module, it will wait for the async scans to finish before we get as far
> > as trying to mount root. It does change observable behaviour in that
> > sys_module_init() will return before scans are complete. However, I
> > believe most distros userspace copes with this these days. For example,
> > Debian has:
> >
> > # wait for the udevd childs to finish
> > log_action_begin_msg "Waiting for /dev to be fully populated"
> > while [ -d /dev/.udev/queue/ ]; do
> > sleep 1
> > udevd_timeout=$(($udevd_timeout - 1))
> > [...]
That has replaced by a binary called "udevsettle" which waits for events
to finish, by comparing the current kernel event sequence number
exported in sysfs with the latest handled event by udev.
> Not sure where that is, but AFAIR that is to process the cold plug case,
> where udev starts up, the hotplug/netlink events are replayed, and we
> don't want to continue until all those events have been processed.
>
> SLES 10 has similar code, but a sleep of 0.1 (see their /etc/init.d/boot.udev,
> and I think /sbin/mkinitrd).
It uses only udevsettle now, also the partitioner and similar needs this
to wait for the partiton table rescan to finish, before continuing using
the new devices.
> > Since the scsi scan is going to be finding new devices the entire time,
> > the queue directory is going to not empty.
Watching only the queue is not enough, cause there are only received
events exported, but not events still in the kernel netlink queue.
Therefore you need to compare the current kernel seqnum like udevsettle
is doing it.
> It won't always be finding new devices, there could be glitches like a
> timeout, or some read (partitition check) that happens to take more than a
> second, and the udev queue becomes empty even though the scsi /sd scan is
> still in progress.
Right. For the settle time of usb-storage we watch for the kernel tread
to go away. :)
> You really want some udev rule that mounts root or such and then the boot
> continues from there ... rather than waiting for an unrelated sets of
> events, and then trying to mount root unconditionally (and possibly
> failing). I thought Hannes or someone had posted an example udev rule or
> such for this. Maybe it is even in SLES 10?
It does not only wait for the queue to become empty. Initramfs creates
dynamic udev rules based on the kernel commandline and waits until the
device appears. The real root (localfs) waits for all needed devices
mentioned in /etc/fstab before continuing.
> Same for applications - you want them to start after a dev (or set of
> devs) shows up, though if we wait for the root dev it is even less likely
> that an app's dev will be unavailable.
>
> Of course if you aren't using udev in your init{rd|ramfs}, udev rules
> and such can't fix the problem :-(
Kay
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x107521&bid$8729&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next prev parent reply other threads:[~2006-06-01 12:22 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060511143352.GI12272@parisc-linux.org>
[not found] ` <20060518172258.GL1604@parisc-linux.org>
[not found] ` <20060529031915.GB23405@parisc-linux.org>
[not found] ` <447AB2F5.2000700@s5r6.in-berlin.de>
[not found] ` <20060529130515.GE23405@parisc-linux.org>
2006-05-31 23:21 ` Asynchronous scsi scanning, version 9 Patrick Mansfield
2006-06-01 12:22 ` Kay Sievers [this message]
2006-10-26 19:53 ` maximilian attems
2006-06-01 13:14 ` Alexander E. Patrakov
2006-06-01 13:21 ` maximilian attems
2006-06-01 13:23 ` Matthew Wilcox
2006-06-01 13:26 ` Alexander E. Patrakov
2006-06-01 14:00 ` Arjan van de Ven
2006-06-25 21:15 ` James Bottomley
2006-06-25 22:46 ` Matthew Wilcox
2006-06-26 8:24 ` Arjan van de Ven
2006-06-26 12:40 ` Matthew Wilcox
2006-06-26 12:59 ` Arjan van de Ven
2006-06-26 16:03 ` Greg KH
2006-06-26 14:44 ` Matthew Dharm
2006-06-26 15:18 ` Matthew Wilcox
2006-06-26 15:44 ` James Bottomley
2006-06-26 16:02 ` Greg KH
2006-06-26 21:08 ` Matthew Dharm
2006-06-26 22:15 ` Matthew Wilcox
2006-06-26 18:55 ` [SPAM] " Doug Ledford
2006-06-26 21:04 ` Matthew Dharm
2006-06-26 21:20 ` Doug Ledford
2006-06-26 20:58 ` Linas Vepstas
2006-06-26 21:14 ` James Bottomley
2006-06-26 21:21 ` Linas Vepstas
2006-06-26 21:41 ` James Bottomley
2006-06-28 7:52 ` Hannes Reinecke
2006-06-28 16:03 ` James Bottomley
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=1149164533.3419.38.camel@pim.off.vrfy.org \
--to=kay.sievers@vrfy.org \
--cc=linux-hotplug-devel@lists.sourceforge.net \
--cc=linux-scsi@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=patmans@us.ibm.com \
--cc=stefanr@s5r6.in-berlin.de \
/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;
as well as URLs for NNTP newsgroup(s).