FS#12706 - [initscripts] A better default in rc.sysinit for a faster boot
Attached to Project:
Arch Linux
Opened by Vahid Hamidullah (vh22) - Wednesday, 07 January 2009, 23:11 GMT
Last edited by Thomas Bächler (brain0) - Wednesday, 11 November 2009, 18:09 GMT
Opened by Vahid Hamidullah (vh22) - Wednesday, 07 January 2009, 23:11 GMT
Last edited by Thomas Bächler (brain0) - Wednesday, 11 November 2009, 18:09 GMT
|
Details
Recently I've been playing around with getting Arch to boot
as fast as possible. Most of the changes I made make the
boot process specific to my machine (turning off autodetect,
loading modules manually...etc). But there was one change
that I believe introduced no instability and I wonder why
its not included by default.
In /etc/rc.sysinit starting on line 119 of a vanilla file Code: /sbin/udevadm trigger /sbin/udevadm settle These lines occur many lines after the udev daemon has been loaded. My question is why not move the trigger line to right after the udev deamon is loaded and run it in the background by default? So the settle line stays in the same spot it is, but move the trigger line up and make make it run in the background: (line 77) Code: /sbin/udevd --daemon /sbin/udevadm trigger & This sped my system up by about 5 seconds and there doesn't seem to be any instability ( I don't see why there would be). So is it possible this could be made the default? |
This task depends upon
Closed by Thomas Bächler (brain0)
Wednesday, 11 November 2009, 18:09 GMT
Reason for closing: Implemented
Wednesday, 11 November 2009, 18:09 GMT
Reason for closing: Implemented
New .30 will introduce fastboot patches which will make module loading even more asynchrous.
But may I suggest to do the trigger in an separate stat_busy stat_done section. This is because initscripts-extras-fbsplash (AUR) hooks into stat_done after stat_busy "Starting UDev Daemon" doing
/sbin/udevadm trigger --subsystem-match=tty --subsystem-match=graphics
/sbin/udevadm settle
to be able to start the Fbsplash daemon. (See
FS#14808for discussion on this.) This normally takes around 100 ms to settle because only a few events are triggered at this point by now. When triggering all right after starting udev the advantage gets lost when fbsplash is installed.Suggested PATCH:
--- etc/rc.sysinit.orig 2009-03-10 22:10:02.000000000 +0100
+++ etc/rc.sysinit 2009-06-25 15:54:10.000000000 +0200
@@ -70,6 +70,13 @@
status "Using static /dev filesystem" true
fi
+# Trigger udev uevents
+if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then
+ stat_busy "Triggering UDev uevents"
+ /sbin/udevadm trigger &
+ stat_done
+fi
+
# Load modules from the MODULES array defined in rc.conf
if ! [ "$load_modules" = "off" ]; then
if [ -f /proc/modules ]; then
@@ -101,11 +108,10 @@
fi
fi
-# run udev uevents
+# Wait for udev uevents
if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then
- stat_busy "Loading UDev uevents"
+ stat_busy "Waiting for UDev uevents to be processed"
udevstart="$(/bin/date +%s%0N)"
- /sbin/udevadm trigger
/sbin/udevadm settle
stat_done
udevend="$(/bin/date +%s%0N)"
Patch in git here for testing: http://projects.archlinux.org/?p=initscripts.git;a=commit;h=fb1177118b663da6b45021cb0ebdb40741047bac
Most of those ordering problems can be solved differently though: For hard drives, we have UUIDs, for audio we can set index=N options in modprobe configuration files. Just saying that we must be careful here!
If we do go forward with this, we will probably need an announcement
/sbin/udevadm trigger --subsystem-nomatch=subsytem [...]
and then later
/sbin/udevadm trigger --subsystem-match=subsytem [...] ?
hard drives: UUIDs, labels
network cards: udev rules based on the MAC address
sound cards: index=? module parameter
Anything else that used to be problematic with changing module ordering?
FS#14569. This way the user could simply move the trigger to the late point if needed.big "maybe": multiple videocards? but there is pciid in xorg.conf
- Load modules from the MODULES array defined in rc.conf
- Trigger udev uevents
- Load modules from a new MODULES2 array defined in rc.conf
- Load standard ACPI modules
- Wait for udev uevents
This way we would only load the ACPI modules and those from the new array MODULES2 concurrent to udev and could keep any critical stuff in MODULES. Looks like so here:
MODULES=(!floppy snd-hda-intel)
MODULES2=(fuse acpi-cpufreq cpufreq_ondemand cpufreq_powersave)
Part of the patch was applied already:
http://projects.archlinux.org/?p=initscripts.git;a=commitdiff;h=fb1177118b663da6b45021cb0ebdb40741047bac
More to the point though, this seems a bit like a work around for module bugs to me than anything else. I'm sure there's a way, with module params, to tell snd-hda-intel to not touch the pcspkr
The PC speaker beep problem is something not worth to add extra var.
See the bottom of this section: http://wiki.archlinux.org/index.php/ALSA#Set_the_default_sound_card
that appeared after http://bugs.archlinux.org/task/12454
Another PC beep related problem was described in this thread: http://www.archlinux.org/pipermail/arch-general/2009-July/006678.html
but it cannot be solved my modules loading order.
I am not aware of any other (not PC speaker related) problems that might warrant adding MODULES2.
brain0 already listed solutions for hard drives and network cards above (http://bugs.archlinux.org/task/12706#comment45987)
@Roman:
modinfo snd-pcsp
modinfo: could not find module snd-pcsp
Because I already found another workaround, my vote on this is now: +-0
as for module name - probably it was changed :-/
2nd point: http://bugs.archlinux.org/task/14958 says it was removed.
grep CONFIG_SND_PCSP /var/abs/core/kernel26/config
# CONFIG_SND_PCSP is not set
I think this is kind of a ALSA sound card driver for the PC speaker. But what I talk about here is the PC beep (console bell or sound from beep binary) which can go thru snd-hda-intel to the stereo jacks since 2.6.30 instead of thru pcspkr to the built in speaker. snd-hda-intel is actually stealing the functionality from module pcspkr.
I think the report can be closed as Implemented now.
input devices were mentioned in http://bugs.archlinux.org/task/15828
Also problems with blacklisting were mentioned in http://bugs.archlinux.org/task/15829
not sure what this has to do with the patch applied.
I agree the report can be closed since fixing weird kernel bugs isn't really the primary scope of initscripts. :-)