[systemd-devel] device enumeration by systemd user instances

Pawel Szewczyk p.szewczyk at samsung.com
Wed Jul 17 15:46:58 UTC 2019


Dear all

I was recently working on reducing booting time and I see one issue that 
I think is worth discussing.

The problem is the device units enumeration seems to take a long time 
(>100ms in our case) before any units are beginning to start. I think 
there is some potential for improvement there. I see that on the system 
I use for testing the user instance of systemd is doing an enumeration 
of devices as well.
Since no matter if the systemd is pid 1 or user instance, it loads the 
same set of units which are tagged 'systemd' in udev, if I understand 
correctly. In user session, however, no unit seems to depend on device 
units, so the whole effort of creating them is for nothing. My guess is 
that for many use cases the device units are not needed by session services.

One of the options that I can think of is to delay the coldplug a bit 
and do it in paralel with all the units loading. As for now, the device 
enumeration happens at the very beginning of systemd lifecycle, along 
with other unit loading. But comparing to loading unit files this looks 
like a time-consuming operation.

So here is the question: is this a safe thing to do? I wonder if trying 
to start units without having device units created would break something 
in systemd.

And did anyone considered this issue before? I would be happy to hear 
your ideas.

Best Regards,
Paweł Szewczyk


More information about the systemd-devel mailing list