mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: "Thomas Bächler" <thomas@archlinux.org>,
	"Arjan van de Ven" <arjan@infradead.org>,
	linux-kernel@vger.kernel.org
Subject: Re: fastboot/async and initramfs: How am I supposed to know when  devices are finished initializing?
Date: Mon, 30 Mar 2009 11:23:57 -0700	[thread overview]
Message-ID: <e9c3a7c20903301123l3f05264cvb8522dd4cb030b2f@mail.gmail.com> (raw)
In-Reply-To: <ac3eb2510903291106k27902bafpa8231d6781f8f5c@mail.gmail.com>

On Sun, Mar 29, 2009 at 11:06 AM, Kay Sievers <kay.sievers@vrfy.org> wrote:
> Assembling meta devices, or multi-volume devices should be triggered
> directly when the underlying devices show up. If auto-assembly (which
> kind of works today with md's --incremental) is properly implemented,
> you should still be able to just wait for the specified root device to
> show up...

Incremental assembly mostly works but it would be nice to have some
event to signal "proceed with degraded assembly because I do not think
any more disks are coming".  With the below patch my thought is that
we can have a rule that:
1/ checks if incremental assembly is in progress (to prevent adding
timeouts to the non-raid path)
2/ checks if the udev event queue is empty
3/ upon finding an idle queue pause to allow last chance discovery
4/ assuming the queue remains idle proceed with degraded assembly

Thoughts?  Perhaps (3) can be eliminated after loading scsi_wait_scan.

Thanks,
Dan

---ws damaged patch---
settle: allow --timeout=0 to test for "queue busy"

From: Dan Williams <dan.j.williams@intel.com>

Allow udevadm settle to be used as a "queue busy" detector.  For use in
a early raid discovery where we want to hold off committing to the
current list of disks while devices might still be arriving.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 udev/udevadm-settle.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/udev/udevadm-settle.c b/udev/udevadm-settle.c
index 867bbed..2fa85a4 100644
--- a/udev/udevadm-settle.c
+++ b/udev/udevadm-settle.c
@@ -85,6 +85,9 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[])
 		usleep(1000 * 1000 / LOOP_PER_SECOND);
 	}

+	if (!udev_queue_get_queue_is_empty(udev_queue))
+		rc = 1;
+
 	/* if we reached the timeout, print the list of remaining events */
 	if (loop <= 0) {
 		struct udev_list_entry *list_entry;
@@ -97,7 +100,6 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[])
 				       udev_list_entry_get_name(list_entry),
 				       udev_list_entry_get_value(list_entry));
 		}
-		rc = 1;
 	}
 exit:
 	udev_queue_unref(udev_queue);

  reply	other threads:[~2009-03-30 18:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-29 16:02 Thomas Bächler
2009-03-29 16:11 ` Arjan van de Ven
2009-03-29 16:39   ` Thomas Bächler
2009-03-29 17:36     ` Kay Sievers
2009-03-29 17:52       ` Thomas Bächler
2009-03-29 18:06         ` Kay Sievers
2009-03-30 18:23           ` Dan Williams [this message]
2009-03-30 18:42             ` Kay Sievers
2009-03-30 19:08               ` Dan Williams
2009-03-29 20:03         ` fastboot/async and initramfs: How am I supposed to know when?devices " Alexander Clouter
2009-03-30 20:20           ` Thomas Bächler
     [not found]   ` <49CFA2CC.9080506@archlinux.org>
     [not found]     ` <20090329094220.4e80c267@infradead.org>
2009-03-29 17:23       ` fastboot/async and initramfs: How am I supposed to know when devices " Thomas Bächler

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=e9c3a7c20903301123l3f05264cvb8522dd4cb030b2f@mail.gmail.com \
    --to=dan.j.williams@intel.com \
    --cc=arjan@infradead.org \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas@archlinux.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

all inboxes | Powered by JetHome®