[systemd-devel] device enumeration by systemd user instances

Lennart Poettering lennart at poettering.net
Tue Jul 23 16:00:08 UTC 2019


On Mi, 17.07.19 17:46, Pawel Szewczyk (p.szewczyk at samsung.com) wrote:

> 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.

Do you have some profiler results about this? i.e. what exactly is the
time spent on?

Note that systemd generally uses udev "tags" for filtering, which
means we should only processes that are actually supposed to show up
as .device units, and nothing else. Before optimizing this, pleas find
out though what the time is actually spent on.

> 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.

Hmm, so some people appear to use this, since we recently fixed a bug
in this area that people noticed while making us of this...

> 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.

Well, the work needs to be done anyway, so what do you gain if you do
it a bit later?

What specifically do you try to optimize? latency until the first
process is started by systemd --user?

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list