[systemd-devel] device enumeration by systemd user instances

Lennart Poettering lennart at poettering.net
Thu Jul 25 16:53:17 UTC 2019


On Do, 25.07.19 17:51, Pawel Szewczyk (p.szewczyk at samsung.com) wrote:

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

80 devices sounds like a lot? On my beefy laptop here i have like 50,
how come it's so many on some ARM device? I'd expect like 10 or so...

normally it should just be a handful of block devices, ttys and
network devices. You got so many of them?

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

Hmm, we recently went the other way, and made the .device handling in
the --user instance more like the one in the system instance.

But you do have a point, it might be worth adding a more resricted
tag there (after all, unpriv userspace should never need to know
anything about block devices, as one example). But also: why is this
so slow and why are so many devices tagged for you? to keep things
simple i'd add a separate tag only as last resort and rather see slow
stuff improved...

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list