[linux-lvm] Discussion: performance issue on event activation mode

David Teigland teigland at redhat.com
Mon Oct 18 15:04:18 UTC 2021

On Mon, Oct 18, 2021 at 06:24:49AM +0000, Martin Wilck wrote:
> I'd like to second Peter here, "RUN" is in general less fragile than
> "IMPORT{PROGRAM}". You should use IMPORT{PROGRAM}" if and only if 
>  - the invoked program can work with incomplete udev state of a device
>    (the progrem should not try to access the device via
>    libudev, it should rather get properties either from sysfs or the
>    uevent's environment variables)
>  - you need the result or the output of the program in order to proceed
>    with rules processing.

Those are both true in this case.  I can't say I like it either, but udev
rules force hacky solutions on us.  I began trying to use RUN several
months ago and I think I gave up trying to find a way to pass values from
the RUN program back into the udev rule (possibly by writing values to a
temp file and then doing IMPORT{file}).  The udev rule needs the name of
the VG to activate, and that name comes from the pvscan.  For an even
uglier form of this, see the equivalent I wrote for dracut:

The latest version of the hybrid service+event activation is here

I've made it simple to edit lvm.conf to switch between:
- activation from fixed services only
- activation from events only
- activation from fixes services first, then from events

There are sure to be tradeoffs, we know that many concurrent activations
from events are slow, and fixed services which are more serialized could
be delayed from slow devices.  I'm still undecided on the best default
setting, i.e. which will work best for most people, and would welcome any
thoughts or relevant experience.


More information about the linux-lvm mailing list