[systemd-devel] device enumeration by systemd user instances

Pawel Szewczyk p.szewczyk at samsung.com
Thu Jul 25 15:51:00 UTC 2019


On 7/23/19 18:00, Lennart Poettering wrote:
> 
> Do you have some profiler results about this? i.e. what exactly is the
> time spent on?

I will probably try to do some 'real' study of this problem by using 
perf or other tool. So far all I know is that the device enumeration 
(i.e. device_enumerate() function in src/core/device) takes around 100ms 
on my arm devices. As I noted before, around 80 devices are enumerated.

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

Of course, someone can use it and it seems reasonable to have the 
ability for device units in user session. I would argue, however, that 
having the same set of devices processed for both 'worlds' is sub-optimal.
Why not have separate tag in udev for 'user' devices, that would be 
enumerated by 'systemd --user'?

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

The same thing that we already get for starting units: the ability to do 
that in parallel with other things.

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

I think the main goal is starting all units in user session as fast as 
possible.


Thanks,
Paweł Szewczyk


More information about the systemd-devel mailing list