[systemd-devel] startup performance

Lennart Poettering lennart at poettering.net
Tue Oct 9 13:24:39 PDT 2012


On Mon, 08.10.12 15:36, Allmeroth, Robert (robert.allmeroth at harman.com) wrote:

> Hello,
> 
> While playing around with systemd and our automotive setup we found that systemd checks some kernel features at startup (from systemd 33).
> static const char * const kmod_table[] = {
>         "autofs4", "/sys/class/misc/autofs",
>         "ipv6",    "/sys/module/ipv6",
>         "unix",    "/proc/net/unix"
> };
> If they are not available - they are modprobed.
> 
> The problem is that any modprobe takes ~1 second, which kills our
> startup.

If this is this slow, it's best to debug this and figure out
why. Loading modules should normally not be that slow.

> If we compile these features into the kernel, the kernel boot time
> increases.
> 
> Question(s):
> Are these kernel features really needed in the early startup phase?

No, they arent't, but we cenrtalized the point where we load these
modules, as these modules are unfortunately not auto-loaded when needed.

> I agree to 'unix' but in an automotive environment 'ipv6' and
> 'autofs4' are typically needed at a later point in the startup (or not
> needed at all).

You can blacklist ipv6 and autofs4 when you dont need them. But I'd
recommend just building autofs4 into the kernel, because it should cost
negligible amount of memory/init time then, and autofs in itself can
help speeding things up, because it allows us to parallize fsck and file
system access.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list