Skip to contentSkip to conversation

udevsynthesize as a udevstart+coldplug replacement

PATCH Kay Sievers 9 participants 27 messages Aug 23, 2005 – Aug 25, 2005 Kbuild

lore
Share & tools
lore
#0 lore raw

Here is "udevsynthesize" a possible replacement for the udevstart/coldplug combination we currently have. Usually very early in the boot process, it gets all available devices from sysfs and synthesizes the events these devices would have generated at creation time.
The events are directly passed to the udevd daemom socket. udevd does all the work and runs all the events asynchronously. udevsynthesize itself does not read any udev rule.

It scans block and class devices to create the the device nodes for already available devices, which obsoletes the run of udevstart.
After that, it scans for bus devices, which events may load modules or configure the device. If the bus type is known, the usual bus-specific values are added to the event environment.

With the "rules-in-daemon" patch, the whole udevstart/coldplug handling (700 events) takes less than a second CPU time on a 1.7Ghz laptop.

A typical boot script would do:
prepare tmpfs on /dev
create /dev/null
start /sbin/udevd
disable /proc/sys/kernel/hotplug (the input layer is still broken and needs a kernel patch) run /sbin/udevsynthesize

Have fun,
Kay

Makefile +9 -2
@@ -53,6 +53,8 @@ MONITOR =	udevmonitor
 INFO =		udevinfo
 TESTER =	udevtest
 STARTER =	udevstart
+SYTHESIZER =	udevsynthesize
+
 RELEASE_NAME =	$(ROOT)-$(VERSION)
 LOCAL_CFG_DIR =	etc/udev
 DESTDIR =
@@ -209,7 +211,7 @@ endif
 GEN_CONFIGS =	$(LOCAL_CFG_DIR)/udev.conf
 
 all: $(ROOT) $(SENDER) $(COMPILE) $(INITSENDER) $(RECORDER) $(CONTROL) $(MONITOR)\
-	$(DAEMON) $(COMPILE) $(INFO) $(TESTER) $(STARTER) $(GEN_CONFIGS) $(KLCC)
+	$(DAEMON) $(COMPILE) $(INFO) $(TESTER) $(STARTER) $(SYTHESIZER) $(GEN_CONFIGS) $(KLCC)
 	@extras="$(EXTRAS)" ; for target in $$extras ; do \
 		echo $$target ; \
 		$(MAKE) prefix=$(prefix) \
@@ -281,6 +283,7 @@ $(RECORDER).o: $(GEN_HEADERS) $(HOST_PRO
 $(CONTROL).o: $(HEADERS) $( $(HEADERS)GEN_HEADERS) $(HOST_PROGS) $(KLCC)
 $(MONITOR).o: $(HEADERS) $( $(HEADERS)GEN_HEADERS) $(HOST_PROGS) $(KLCC)
 $(STARTER).o: $(HEADERS) $(GEN_HEADERS) $(HOST_PROGS) $(KLCC)
+$(SYTHESIZER).o: $(HEADERS) $(GEN_HEADERS) $(HOST_PROGS) $(KLCC)
 
 $(ROOT): $(KLCC) $(ROOT).o $(OBJS) $(HEADERS) $(GEN_MANPAGES)
 	$(QUIET) $(LD) $(LDFLAGS) -o $@ $(ROOT).o $(OBJS) $(LIB_OBJS)
@@ -326,6 +329,10 @@ $(STARTER): $(KLCC) $(STARTER).o $(OBJS)
 	$(QUIET) $(LD) $(LDFLAGS) -o $@ $(STARTER).o $(OBJS) $(LIB_OBJS)
 	$(QUIET) $(STRIPCMD) $@
 
+$(SYTHESIZER): $(KLCC) $(SYTHESIZER).o $(OBJS)
+	$(QUIET) $(LD) $(LDFLAGS) -o $@ $(SYTHESIZER).o $(OBJS) $(LIB_OBJS)
+	$(QUIET) $(STRIPCMD) $@
+
 .c.o:
 	$(QUIET) $(CC) $(CFLAGS) -c -o $@ $<
 
@@ -333,7 +340,7 @@ clean:
 	-find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \
 	 | xargs rm -f 
 	-rm -f core $(ROOT) $(GEN_HEADERS) $(GEN_CONFIGS) $(GEN_MANPAGES) $(INFO) $(DAEMON) \
-	 $(SENDER) $(COMPILE) $(INITSENDER) $(RECORDER) $(CONTROL) $(MONITOR) $(TESTER) $(STARTER)
+	 $(SENDER) $(COMPILE) $(INITSENDER) $(RECORDER) $(CONTROL) $(MONITOR) $(TESTER) $(STARTER) $(SYTHESIZER)
 	-rm -f ccdv
 	$(MAKE) -C klibc SUBDIRS=klibc clean
 	@extras="$(EXTRAS)" ; for target in $$extras ; do \
udevsynthesize.c new file +708 -0

708 lines not on this page · raw message

#1 lore raw
Quoted 24 lines · Kay Sievers

Here is "udevsynthesize" a possible replacement for the udevstart/coldplug combination we currently have. Usually very early in the boot process, it gets all available devices from sysfs and synthesizes the events these devices would have generated at creation time.
The events are directly passed to the udevd daemom socket. udevd does all the work and runs all the events asynchronously. udevsynthesize itself does not read any udev rule.

It scans block and class devices to create the the device nodes for already available devices, which obsoletes the run of udevstart.
After that, it scans for bus devices, which events may load modules or configure the device. If the bus type is known, the usual bus-specific values are added to the event environment.

With the "rules-in-daemon" patch, the whole udevstart/coldplug handling (700 events) takes less than a second CPU time on a 1.7Ghz laptop.

A typical boot script would do:
prepare tmpfs on /dev
create /dev/null
start /sbin/udevd
disable /proc/sys/kernel/hotplug (the input layer is still broken and needs a kernel patch) run /sbin/udevsynthesize

Quoted 4 lines

Have fun,
Kay

What if udevd receives netlink messages and goes into "ignore unix socket" mode before/while synthesize?

--Mika

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Kay Sievers
Quoted 28 lines · Mika Penttilä
Quoted 18 lines · Kay Sievers

Here is "udevsynthesize" a possible replacement for the udevstart/coldplug combination we currently have. Usually very early in the boot process, it gets all available devices from sysfs and synthesizes the events these devices would have generated at creation time.
The events are directly passed to the udevd daemom socket. udevd does all the
work and runs all the events asynchronously. udevsynthesize itself does not read any udev rule.

It scans block and class devices to create the the device nodes for already available devices, which obsoletes the run of udevstart.
After that, it scans for bus devices, which events may load modules or configure the device. If the bus type is known, the usual bus-specific values are added to the event environment.

With the "rules-in-daemon" patch, the whole udevstart/coldplug handling (700 events) takes less than a second CPU time on a 1.7Ghz laptop.

Quoted 7 lines

A typical boot script would do:
prepare tmpfs on /dev
create /dev/null
start /sbin/udevd
disable /proc/sys/kernel/hotplug (the input layer is still broken and needs a kernel patch)
run /sbin/udevsynthesize

Quoted 2 lines

What if udevd receives netlink messages and goes into "ignore unix socket" mode before/while synthesize?

No such mode exists. :) Only events with a SEQNUM set will possibly be ignored if received from userspace after netlink activity is detected.

Kay

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Kay Sievers
Quoted 42 lines · Kay Sievers
Quoted 34 lines · Mika Penttilä
Quoted 18 lines · Kay Sievers

Here is "udevsynthesize" a possible replacement for the udevstart/coldplug combination we currently have. Usually very early in the boot process, it gets all available devices from sysfs and synthesizes the events these devices would have generated at creation time.
The events are directly passed to the udevd daemom socket. udevd does all the
work and runs all the events asynchronously. udevsynthesize itself does not read any udev rule.

It scans block and class devices to create the the device nodes for already available devices, which obsoletes the run of udevstart.
After that, it scans for bus devices, which events may load modules or configure the device. If the bus type is known, the usual bus-specific values are added to the event environment.

With the "rules-in-daemon" patch, the whole udevstart/coldplug handling (700 events) takes less than a second CPU time on a 1.7Ghz laptop.

Quoted 9 lines

A typical boot script would do:
prepare tmpfs on /dev
create /dev/null
start /sbin/udevd
disable /proc/sys/kernel/hotplug (the input layer is still broken and needs a kernel patch)
run /sbin/udevsynthesize

Quoted 4 lines

What if udevd receives netlink messages and goes into "ignore unix socket" mode before/while synthesize?

Quoted 7 lines

No such mode exists. :) Only events with a SEQNUM set will possibly be ignored if received from userspace after netlink activity is detected.

Kay

Ok, there's the (seqnum != 0 && netlink active) test which keeps these messages passing through.

Thanks,
Mika

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Kay Sievers
Quoted 8 lines · * Kay Sievers ([email protected]) wrote:

Here is "udevsynthesize" a possible replacement for the udevstart/coldplug combination we currently have. Usually very early in the boot process, it gets all available devices from sysfs and synthesizes the events these devices would have generated at creation time.
The events are directly passed to the udevd daemom socket. udevd does all the work and runs all the events asynchronously. udevsynthesize itself does not read any udev rule.

Quoted 5 lines

It scans block and class devices to create the the device nodes for already available devices, which obsoletes the run of udevstart.
After that, it scans for bus devices, which events may load modules or configure the device. If the bus type is known, the usual bus-specific values are added to the event environment.

Conceptually (Meaning I havn't carefully examined the code yet) this looks great! Thanks for doing this Kay!

It's nice to see the hotplug+udev combo finally getting in to shape and becoming more streamlined and lightweight.

Thanks a bunch!

/Pelle

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#5 lore raw
In reply to Kay Sievers
Quoted 24 lines · Kay Sievers

Here is "udevsynthesize" a possible replacement for the udevstart/coldplug combination we currently have. Usually very early in the boot process, it gets all available devices from sysfs and synthesizes the events these devices would have generated at creation time.
The events are directly passed to the udevd daemom socket. udevd does all the work and runs all the events asynchronously. udevsynthesize itself does not read any udev rule.

It scans block and class devices to create the the device nodes for already available devices, which obsoletes the run of udevstart.
After that, it scans for bus devices, which events may load modules or configure the device. If the bus type is known, the usual bus-specific values are added to the event environment.

With the "rules-in-daemon" patch, the whole udevstart/coldplug handling (700 events) takes less than a second CPU time on a 1.7Ghz laptop.

A typical boot script would do:
prepare tmpfs on /dev
create /dev/null
start /sbin/udevd
disable /proc/sys/kernel/hotplug (the input layer is still broken and needs a kernel patch) run /sbin/udevsynthesize

Quoted 4 lines

Have fun,
Kay

Could you please tell where to add swap activation and ext2 filesystem checks in this scenario to make sure that there's no race between udev (that creates the device asynchronously, as you said) and swapon/fsck (that may want to use the device)?

Signature · 12 lines
Alexander E. Patrakov


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#6 lore raw
In reply to Kay Sievers
Quoted 4 lines · Alexander E. Patrakov

Could you please tell where to add swap activation and ext2 filesystem checks in this scenario to make sure that there's no race between udev (that creates the device asynchronously, as you said) and swapon/fsck (that may want to use the device)?

This is no different than with udevstart: the program is supposed to not return until all devices have been created.

Signature · 13 lines
ciao,
Marco


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#7 lore raw
In reply to Kay Sievers
Quoted 2 lines · Kay Sievers

Here is "udevsynthesize" a possible replacement for the udevstart/coldplug combination we currently have. Usually very early in the boot process, it

What are the benefits of using C instead of shell scripts? An obvious disadvantage is that it would be harder to add support for new bus types.

Signature · 2 lines
ciao,
Marco
#8 lore raw
In reply to Kay Sievers
Quoted 4 lines · Kay Sievers

Here is "udevsynthesize" a possible replacement for the udevstart/coldplug combination we currently have. Usually very early in the boot process, it gets all available devices from sysfs and synthesizes the events these devices would have generated at creation time.

That's mostly udevstart + async mode + the (really much improved) coldplug support I proposed some days ago :-)
Though, it would have been nice to announce you'd handle that in the previous "USB coldplug" thread, it looked like you were not in favor of pushing such bus coldplug support.

I'd still like a --disable-bus= option so that distro vendors can forbid bus coldplug they don't like.
I'm not sure most distro are ready to have udevstart automatically load modules on the pci bus. For example network and sound drivers are often handled separately.
Should I take care of this patch?

And why not keeping the udevstart name? The previous udevstart can be replaced by this udevsynthesize. They fulfill the same tasks, the only difference is async mode + bus coldplug, does it justify a name change?

BTW, it's nice to see you've synthetized most useful bus-specific environment variables, nice work.

Quoted 3 lines

The events are directly passed to the udevd daemom socket. udevd does all the work and runs all the events asynchronously. udevsynthesize itself does not read any udev rule.

Good job!

Signature · 15 lines
Olivier Blin
Mandriva
Mandrakesoft becomes Mandriva



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#9 lore raw
In reply to Kay Sievers
Quoted 7 lines · Olivier Blin
Quoted 4 lines · Kay Sievers

Here is "udevsynthesize" a possible replacement for the udevstart/coldplug combination we currently have. Usually very early in the boot process, it gets all available devices from sysfs and synthesizes the events these devices would have generated at creation time.

Quoted 5 lines

That's mostly udevstart + async mode + the (really much improved) coldplug support I proposed some days ago :-)
Though, it would have been nice to announce you'd handle that in the previous "USB coldplug" thread, it looked like you were not in favor of pushing such bus coldplug support.

As pinted out earlier, it's a very different approch with complete different problems to do it async.

Quoted 6 lines

I'd still like a --disable-bus= option so that distro vendors can forbid bus coldplug they don't like.
I'm not sure most distro are ready to have udevstart automatically load modules on the pci bus. For example network and sound drivers are often handled separately.
Should I take care of this patch?

_Not_ handling these events is just a special case of handling it, so a rule can prevent the event from doing anything. I prefer a single source of policy as long as this is possible.

Quoted 4 lines

And why not keeping the udevstart name? The previous udevstart can be replaced by this udevsynthesize. They fulfill the same tasks, the only difference is async mode + bus coldplug, does it justify a name change?

As said earlier, udevstart is the most critical part of udev. We should not play around with that. And Olaf was right, the name is misleading and should change anyway. :)

Thanks,
Kay

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#10 lore raw
In reply to Kay Sievers
Quoted 2 lines · Kay Sievers

As pinted out earlier, it's a very different approch with complete different problems to do it async.

Yes, it's the one you've described in reply to my posts, but you haven't said you would implement it :-)

Quoted 10 lines
Quoted 6 lines

I'd still like a --disable-bus= option so that distro vendors can forbid bus coldplug they don't like.
I'm not sure most distro are ready to have udevstart automatically load modules on the pci bus. For example network and sound drivers are often handled separately.
Should I take care of this patch?

_Not_ handling these events is just a special case of handling it, so a rule can prevent the event from doing anything. I prefer a single source of policy as long as this is possible.

One may want to handle USB hotplugging, but not USB coldplugging. I don't think there is a solution to differentiate hotplug from coldplug in udev rules (but maybe I'm missing something).

Quoted 3 lines

As said earlier, udevstart is the most critical part of udev. We should not play around with that. And Olaf was right, the name is misleading and should change anyway. :)

Fair enough.

Signature · 15 lines
Olivier Blin
Mandriva
Mandrakesoft becomes Mandriva



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#11 lore raw
In reply to Kay Sievers
Quoted 7 lines · Olivier Blin
Quoted 2 lines · Kay Sievers

As pinted out earlier, it's a very different approch with complete different problems to do it async.

Yes, it's the one you've described in reply to my posts, but you haven't said you would implement it :-)

It took only a long night. :)

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

I'd still like a --disable-bus= option so that distro vendors can forbid bus coldplug they don't like.
I'm not sure most distro are ready to have udevstart automatically load modules on the pci bus. For example network and sound drivers are often handled separately.
Should I take care of this patch?

Quoted 7 lines
Quoted 3 lines

_Not_ handling these events is just a special case of handling it, so a rule can prevent the event from doing anything. I prefer a single source of policy as long as this is possible.

One may want to handle USB hotplugging, but not USB coldplugging. I don't think there is a solution to differentiate hotplug from coldplug in udev rules (but maybe I'm missing something).

In the same way you can recognize udevstart by finding UDEV_START in the environment, you will find UDEV_SYNTHESIZE in the env. :)

Thanks,
Kay

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#12 lore raw
In reply to Kay Sievers
Quoted 8 lines · Marco d'Itri
Quoted 4 lines · Alexander E. Patrakov

Could you please tell where to add swap activation and ext2 filesystem checks in this scenario to make sure that there's no race between udev (that creates the device asynchronously, as you said) and swapon/fsck (that may want to use the device)?

This is no different than with udevstart: the program is supposed to not return until all devices have been created.

No Alexander asked a good question, it will return after all events are passed to the daemon. We will need figure out, how to deal with that or resolve such dependencies.

Kay

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#13 lore raw
In reply to Kay Sievers
Quoted 3 lines · Kay Sievers

No Alexander asked a good question, it will return after all events are passed to the daemon. We will need figure out, how to deal with that or resolve such dependencies.

What about a new udevcontrol parameter which makes it block until the udevd is done? This way if needed it could be run in a different init script to allow parallel processing at boot time.

Signature · 2 lines
ciao,
Marco
#14 lore raw
In reply to Kay Sievers
Quoted 2 lines · Kay Sievers

In the same way you can recognize udevstart by finding UDEV_START in the environment, you will find UDEV_SYNTHESIZE in the env. :)

it would be nice to document this.
"fgrep -r" isn't a nice doc :-(

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#15 lore raw
In reply to Kay Sievers
Quoted 5 lines · Marco d'Itri
Quoted 2 lines · Kay Sievers

Here is "udevsynthesize" a possible replacement for the udevstart/coldplug combination we currently have. Usually very early in the boot process, it

What are the benefits of using C instead of shell scripts?

Nobody knows. I like it, probably. :)
I like to connect directly to the daemon socket and it was easy to do, cause it's was a bit similar to udevstart.

Quoted 2 lines

An obvious disadvantage is that it would be harder to add support for new bus types.

Sure, it's easier to copy another *.rc script than to add a *_handler(), but udev has a release frequency high enough, that I don't think this would be a real problem.

We will need to find out _what_ we need to do on coldplug, and not _how_ to do it, right?

Kay

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#16 lore raw
In reply to Kay Sievers
Quoted 7 lines · Thierry Vignaud
Quoted 2 lines · Kay Sievers

In the same way you can recognize udevstart by finding UDEV_START in the environment, you will find UDEV_SYNTHESIZE in the env. :)

it would be nice to document this.
"fgrep -r" isn't a nice doc :-(

You mean the "UDEV_START"? Sure, patches to the udevstart man page are welcome. :)

Kay

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#17 lore raw
In reply to Kay Sievers
Quoted 7 lines · Marco d'Itri
Quoted 3 lines · Kay Sievers

No Alexander asked a good question, it will return after all events are passed to the daemon. We will need figure out, how to deal with that or resolve such dependencies.

What about a new udevcontrol parameter which makes it block until the udevd is done?

What state is "udevd is done"? No event in the queue?

Quoted 2 lines

This way if needed it could be run in a different init script to allow parallel processing at boot time.

Hmm, what do you mean? Who waits for whom?

Kay

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#18 lore raw
In reply to Kay Sievers
Quoted 3 lines · Kay Sievers
Quoted 2 lines

What about a new udevcontrol parameter which makes it block until the udevd is done?

What state is "udevd is done"? No event in the queue?

Unless you can think about something smarter, yes.

Quoted 3 lines
Quoted 2 lines

This way if needed it could be run in a different init script to allow parallel processing at boot time.

Hmm, what do you mean? Who waits for whom?

multiple init scripts would depend on the udev-done (or something like this) init script, which will not terminale until udevcontrol will. This way other init scripts would be able to continue working without needing to wait for udev.
Or maybe it's not worth the effort, because they would need to use /some/ device node anyway.

Signature · 2 lines
ciao,
Marco
#19 lore raw
In reply to Kay Sievers
Quoted 6 lines · Kay Sievers
Quoted 3 lines

One may want to handle USB hotplugging, but not USB coldplugging. I don't think there is a solution to differentiate hotplug from coldplug in udev rules (but maybe I'm missing something).

In the same way you can recognize udevstart by finding UDEV_START in the environment, you will find UDEV_SYNTHESIZE in the env. :)

Oh right, then we can simply use something like ENV{UDEV_SYNTHESIZE}="" to handle real hotplug only. Thanks

Signature · 15 lines
Olivier Blin
Mandriva
Mandrakesoft becomes Mandriva



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#20 lore raw
In reply to Kay Sievers
Quoted 8 lines · Kay Sievers
Quoted 6 lines
Quoted 3 lines

In the same way you can recognize udevstart by finding UDEV_START in the environment, you will find UDEV_SYNTHESIZE in the env. :)

it would be nice to document this.
"fgrep -r" isn't a nice doc :-(

You mean the "UDEV_START"? Sure,

yep

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#21 lore raw
In reply to Kay Sievers
Quoted 6 lines · Marco d'Itri
Quoted 3 lines · Kay Sievers
Quoted 2 lines

What about a new udevcontrol parameter which makes it block until the udevd is done?

What state is "udevd is done"? No event in the queue?

Unless you can think about something smarter, yes.

No UDEV_SYNTHESIZE event in the queue.

Quoted 9 lines
Quoted 3 lines
Quoted 2 lines

This way if needed it could be run in a different init script to allow parallel processing at boot time.

Hmm, what do you mean? Who waits for whom?

multiple init scripts would depend on the udev-done (or something like this) init script, which will not terminale until udevcontrol will. This way other init scripts would be able to continue working without needing to wait for udev.
Or maybe it's not worth the effort, because they would need to use /some/ device node anyway.

Why not make the init scripts wait individually for whatever they need?

Signature · 14 lines
ciao, christian

睡眠不足はいい仕事の敵だ。


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#22 lore raw
In reply to Kay Sievers
Quoted 7 lines · Christian Zoz
Quoted 6 lines

multiple init scripts would depend on the udev-done (or something like this) init script, which will not terminale until udevcontrol will. This way other init scripts would be able to continue working without needing to wait for udev.
Or maybe it's not worth the effort, because they would need to use /some/ device node anyway.

Why not make the init scripts wait individually for whatever they need?

How?

Signature · 13 lines
ciao,
Marco


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#23 lore raw
In reply to Kay Sievers
Quoted 10 lines · Marco d'Itri
Quoted 7 lines · Christian Zoz
Quoted 6 lines

multiple init scripts would depend on the udev-done (or something like this) init script, which will not terminale until udevcontrol will. This way other init scripts would be able to continue working without needing to wait for udev.
Or maybe it's not worth the effort, because they would need to use /some/ device node anyway.

Why not make the init scripts wait individually for whatever they need?

How?

That is a bigger change in init scripts. Each init script needs a list of requirements, similar to the required services now. The scripts could be called like it is done up to now and then each script has to check its requirements and fail after reasonable timeout. Or there is an instance that checks requirements of different services and calls them as soon as all requirements are fulfilled.

There is a third way: We currently initialize devices and interfaces (class devices, block devices) via events. Why not extend this and trigger events when a certain state of system intialisation is reached.

This all are still very raw ideas. But i don't like the current way of system initialisation, that tries to serialize everything, not so much. It makes to much trouble with hotplug.

Signature · 14 lines
ciao, christian

睡眠不足はいい仕事の敵だ。


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#24 lore raw
In reply to Kay Sievers
Quoted 2 lines · Christian Zoz

This all are still very raw ideas. But i don't like the current way of system initialisation, that tries to serialize everything, not so

All interesting (and many already implemented), but I see future improvements of the boot process as an orthogonal problem to making udev work with the current one.

Signature · 13 lines
ciao,
Marco


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#25 lore raw
In reply to Kay Sievers
Quoted 3 lines · Marco d'Itri
Quoted 2 lines
Quoted 1 line

udevd is done?

What state is "udevd is done"? No event in the queue?

Unless you can think about something smarter, yes.

So, given the scenario:

udevsyn goes through PCI bus, sends events.

udevd reads these events, loads PCI modules. Possibly including
a USB controller.

<time point A>

USB controller scans bus, sends events from kernel.

udevd reads these events, loads USB modules. Possibly including
USB storage.

<time point B>

usb-storage scans bus, sends events from kernel>

udevd reads these events, creates SCSI devices.

<time point C>

So, in theory, this 'udevd is done' could be signaled at either A, B, or C, as I understand things.

Speaking of that, what prioritization is there in udevsynthesize? Realistically, I think you'd always want to load USB and firewire controller modules last when scanning the PCI bus, as a means of enforcing 'polite' device ordering (while you can't always ensure LANANA device names are consistent, it's polite to make sure your USB stick doesn't jump to /dev/sda ahead of your SATA drive.)

Bill

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#26 lore raw
In reply to Kay Sievers
Quoted 1 line · Bill Nottingham

USB controller scans bus, sends events from kernel.

This is something I have been thinking about recently: events for a bus should be synthesized only if the bus driver was not loaded at the time the coldplug program is started, or they would be duplicated. What needs to be checked in sysfs?
I think that all existing coldplug implementations suffer of this bug.

Quoted 2 lines

So, in theory, this 'udevd is done' could be signaled at either A, B, or C, as I understand things.

I meant to do it for A, which would be like how udevstart currently works.

Quoted 6 lines

Speaking of that, what prioritization is there in udevsynthesize? Realistically, I think you'd always want to load USB and firewire controller modules last when scanning the PCI bus, as a means of enforcing 'polite' device ordering (while you can't always ensure LANANA device names are consistent, it's polite to make sure your USB stick doesn't jump to /dev/sda ahead of your SATA drive.)

I agree that this is desired (eth1394 becoming eth0 is a classic example), but I am not sure about how hard it would be to implement.

Signature · 2 lines
ciao,
Marco