[systemd-devel] Improve boot-time of systemd

Lennart Poettering lennart at poettering.net
Tue Apr 19 17:43:36 PDT 2011


On Fri, 18.03.11 13:40, Gustavo Sverzut Barbieri (barbieri at profusion.mobi) wrote:

> 
> On Fri, Mar 18, 2011 at 10:52 AM, Andrey Borzenkov <arvidjaar at mail.ru> wrote:
> > On Fri, Mar 18, 2011 at 12:35 PM, fykcee1 at gmail.com <fykcee1 at gmail.com> wrote:
> >> Hi all,
> >>
> >> We did a series boot-time tests of systemd, and found some interesting things:
> >> (Note the tests were performed on a laptop with a 4-core mips cpu, AMD
> >> RS780 chipset, 2GB Memory, rotate harddisk with ext4 filesystem,
> >> debian squeeze, Linux 2.6.36 with fanotify enabled, systemd-v20, only
> >> boot to console.)
> >>
> >> 1. What can readahead affect boot-time?
> >> Sadly observed negative affect -- boot-time increases at least 1s.
> >
> > From subjective feelings (no real measurements) I confirm it.
> 
> I noticed it as well, even with my Macbook Pro i7 with 8Gb RAM and
> 128SSD using btrfs.

Note that btrfs is actually not particularly fast when mounting.

> ACK. Maybe we should add some intelligence to systemd's automatic
> unit-mount creation and serialize partition mounts of the same device?
> For traditional systems it's easy, just make all /dev/sda* depend on
> each other, but world is bit harder and multiple-device FS like btrfs
> or even DM will screw with that. Ideas? Maybe we could do it just
> based on /etc/fstab, sorting dependencies based on /dev/sda* and
> respective mountpoints.

We do serialization of fsck on rotating media already. This might be
something that fixes itself as soon as the btrfs mounting isn't as slow
anymore as it currently is.

> Well, I never tried other distro other than Gentoo on this Macbook and
> here it's kinda fast at 7s to be 100% ready with E17 (I have an
> autostart .desktop that writes to /dev/kmsg to measure it), "Startup
> finished in 2s 360ms 651us (kernel) + 1s 753ms 783us (userspace) = 4s
> 114ms 434us."

We are below 1s for userspace here now, on a reasonably complete GNOME
machine. You might be able to kill off udev-settle on your machine to
achieve that, together with udev from git.

> As a last note, what piss me off is the fact that some things affect
> boot time but they should not, and it's not systemd's fault. For
> instance with both nvidia and intel on another PC I have around 1s
> slowdown when I'm using external monitors! Damn, 14% of my boot time
> because of that?

We should be able to fix this too, as there is no need to synchronize on
the DRI driver initialization. On fedora Plymouth currently forces us to
do this before we can start it, since it expects all graphics devices to
be probed before it starts. If ply and gdm/X are fixed to pick up
graphics cards as they become available we could remove a couple of sync
points from the boot, which currently cost me about 3s of boot time
here.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list