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

heming.zhao at suse.com heming.zhao at suse.com
Wed Jun 16 16:18:47 UTC 2021

On 6/16/21 1:03 AM, David Teigland wrote:
> On Tue, Jun 08, 2021 at 10:39:37AM -0500, David Teigland wrote:
>> I think it would be an improvement to:
>> . Make obtain_device_list_from_udev only control how we get the device
>>    list. Then we can easily default to 0 and readdir /dev if it's better.
>> . Use both native md/mpath detection *and* udev info when it's readily
>>    available (don't wait for it), instead of limiting ourselves to one
>>    source of info.  If either source indicates an md/mpath component,
>>    then we consider it true.
>> The second point means we are free to change obtain_device_list_from_udev
>> as we wish, without affecting md/mpath detection.  It may also improve
>> md/mpath detection overall.
> Here are the initial patches I'm testing (libmpathvalid not yet added)
> https://sourceware.org/git/?p=lvm2.git;a=shortlog;h=refs/heads/dev-dct-device-info-1

I compiled & tested the code.
I don't know if I missed something, the result didn't show any progress.
the result of "devices/obtain_device_list_from_udev=0" even got regression: from 23.3 => 39.8

the lvm2 version with dev-dct-device-info-1 branch code
sle15sp2-base40g:~ # lvm version
   LVM version:     2.03.13(2)-git (2021-05-07)
   Library version: 1.02.179-git (2021-05-07)
   Driver version:  4.40.0
   Configuration:   ./configure --host=x86_64-suse-linux-gnu --build=x86_64-suse-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/lib --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --enable-dmeventd --enable-cmdlib --enable-udev_rules --enable-udev_sync --with-udev-prefix=/usr/ --enable-selinux --enable-pkgconfig --with-usrlibdir=/usr/lib64 --with-usrsbindir=/usr/sbin --with-default-dm-run-dir=/run --with-tmpfilesdir=/usr/lib/tmpfiles.d --with-thin=internal --with-device-gid=6 --with-device-mode=0640 --with-device-uid=0 --with-dmeventd-path=/usr/sbin/dmeventd --with-thin-check=/usr/sbin/thin_check --with-thin-dump=/usr/sbin/thin_dump --with-thin-repair=/usr/sbin/thin_repair --enable-blkid_wiping --enable-lvmpolld --enable-realtime --with-cache=internal --with-default-locking-dir=/run/lock/lvm --with-default-pid-dir=/run --with-default-run-dir=/run/lvm --enable-fsadm --disable-silent-rules --enable-write_install --with-vdo=none

Installation with cmd: make install && dracut -f --add "lvm"

top 10 blame services
external_device_info_source = "none"
obtain_device_list_from_udev = 1
event_activation = 1
udev_sync = 1

sle15sp2-base40g:~ # systemd-analyze blame | head -n 10
      2min 4.515s lvm2-pvscan at 135:720.service
      2min 4.332s lvm2-pvscan at 135:704.service
      2min 3.162s lvm2-pvscan at 8:768.service
      2min 2.168s lvm2-pvscan at 135:672.service
      2min 2.166s lvm2-pvscan at 135:688.service
     1min 55.275s lvm2-pvscan at 130:688.service
     1min 52.541s lvm2-pvscan at 135:656.service
     1min 52.483s lvm2-pvscan at 135:640.service
     1min 51.066s lvm2-pvscan at 128:688.service
     1min 51.065s lvm2-pvscan at 128:704.service


sle15sp2-base40g:~ # systemd-analyze blame | head -n 10
          39.845s lvm2-pvscan at 133:576.service
          39.830s lvm2-pvscan at 133:640.service
          39.829s lvm2-pvscan at 133:720.service
          39.827s lvm2-pvscan at 132:736.service
          39.825s lvm2-pvscan at 132:656.service
          39.823s lvm2-pvscan at 132:672.service
          39.821s lvm2-pvscan at 132:720.service
          39.820s lvm2-pvscan at 132:544.service
          39.819s lvm2-pvscan at 132:624.service
          39.808s lvm2-pvscan at 132:576.servic

*** compare with my previous test result. (list in below) ***

external_device_info_source = "none"

      2min 6.736s lvm2-pvscan at 70:384.service
      2min 6.628s lvm2-pvscan at 70:400.service
      2min 6.554s lvm2-pvscan at 69:432.service
      2min 6.518s lvm2-pvscan at 69:480.service
      2min 6.478s lvm2-pvscan at 69:416.service
      2min 6.277s lvm2-pvscan at 69:464.service
      2min 5.791s lvm2-pvscan at 69:544.service


          34.908s dracut-initqueue.service
          25.440s systemd-udev-settle.service
          23.335s lvm2-pvscan at 66:832.service
          23.335s lvm2-pvscan at 65:976.service
          23.335s lvm2-pvscan at 66:784.service
          23.335s lvm2-pvscan at 65:816.service
          23.335s lvm2-pvscan at 8:976.service
          23.327s lvm2-pvscan at 66:864.service
          23.323s lvm2-pvscan at 66:848.service
          23.316s lvm2-pvscan at 65:800.service


More information about the linux-lvm mailing list