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

heming.zhao at suse.com heming.zhao at suse.com
Mon Oct 18 16:56:37 UTC 2021


On 10/18/21 23:04, David Teigland wrote:
> 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:
> https://github.com/dracutdevs/dracut/pull/1567/files
> 
> The latest version of the hybrid service+event activation is here
> https://sourceware.org/git/?p=lvm2.git;a=shortlog;h=refs/heads/dev-dct-activation-switch-7
> 
> 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

For the branch code of dev-dct-activation-switch-7, If the comment before
event_activation_enable() is correct. option "event_activation" becomes useless.
I still prefer to use one switcher to control all behaviors.

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

from my test results, I never meet delay issue under serialized mode (except udev.children_max=1).
I prefer to set services first, then events. This style will triggers performance issue after
entering events mode, but this is under expectation.

Thanks,
Heming




More information about the linux-lvm mailing list