Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 437718

Summary: sys-fs/lvm2-2.02.97 /etc/init.d/lvm-monitoring slows down boot and shutdown on systems with multiple vgs
Product: Gentoo Linux Reporter: Norman Back <gentoo2>
Component: [OLD] Core systemAssignee: Robin Johnson <robbat2>
Status: RESOLVED FIXED    
Severity: normal CC: agk, cardoe, proxy-maint
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: proposed patch to fix issue
corrected patch

Description Norman Back 2012-10-09 13:59:41 UTC
/etc/init.d/lvm-monitoring starts and stops monitoring each lvm individually. It is possible and much quicker to change all lvms in one call to vgchange.

Reproducible: Always

Steps to Reproduce:
1. Install sys-fs/lvm2-2.02.97 on a system with multiple vgs
2. boot and shutdown system

Actual Results:  
boot and shutdown completes OK but lvm-monitoring start and stop is slow (10 seconds on my system)

Expected Results:  
boot and shutdown completes OK but lvm-monitoring start and stop is quick.

diff of proposed fix:
--- lvm-monitoring.initd-2.02.67-r2     2010-08-20 20:18:29.000000000 +0100
+++ /tmp/lvm-monitoring 2012-10-09 14:50:25.974888973 +0100
@@ -18,29 +18,22 @@
 start() {
        ret=0
        # TODO do we want to separate out already active groups only?
-       VGSLIST=`$VGS --noheadings -o name 2> /dev/null`
-       for vg in $VGSLIST
-       do
-           ebegin "Starting LVM monitoring for VG $vg:"
-               $VGCHANGE --monitor y --poll y $vg
-               ret2=$?
-               eend $ret2
-               [ $ret2 -ne 0 ] && ret=$ret2
-       done
+       VGSLIST=`$VGS --noheadings -o name --rows 2> /dev/null`
+       ebegin "Starting LVM monitoring for VGs ${VGSLIST}:"
+       $VGCHANGE --monitor y --poll y  ${VGSLIST}
+       ret=$?
+       eend $ret
        return $ret
 }
 
 stop() {
        ret=0
        # TODO do we want to separate out already active groups only?
-       VGSLIST=`$VGS --noheadings -o name 2> /dev/null`
-       for vg in $VGSLIST
-       do
-           ebegin "Stopping LVM monitoring for VG $vg:"
-               $VGCHANGE --monitor n $vg
-               ret2=$?
-               eend $ret2
-               [ $ret2 -ne 0 ] && ret=$ret2
-       done
+       VGSLIST=`$VGS --noheadings -o name --rows 2> /dev/null`
+        ebegin "Stopping LVM monitoring for VGs ${VGSLIST}:"
+       $VGCHANGE --monitor y --poll y  ${VGSLIST}
+       ret=$?
+       eend $ret
+
        return $ret
 }
Comment 1 Norman Back 2012-10-09 14:00:25 UTC
Created attachment 326088 [details, diff]
proposed patch to fix issue
Comment 2 Norman Back 2012-12-20 15:54:18 UTC
Example output to rc.log

Without patch:

* Stopping LVM monitoring for VG syssda10: ...
  6 logical volume(s) in volume group "syssda10" unmonitored
 [ ok ]
 * Stopping LVM monitoring for VG syssda12: ...
  6 logical volume(s) in volume group "syssda12" unmonitored
 [ ok ]
 * Stopping LVM monitoring for VG syssdb10: ...
  7 logical volume(s) in volume group "syssdb10" unmonitored
 [ ok ]
 * Stopping LVM monitoring for VG syssdb11: ...
  7 logical volume(s) in volume group "syssdb11" unmonitored
 [ ok ]
 * Stopping LVM monitoring for VG syssdb6: ...
  6 logical volume(s) in volume group "syssdb6" unmonitored
 [ ok ]
 * Stopping LVM monitoring for VG syssdb8: ...
  6 logical volume(s) in volume group "syssdb8" unmonitored
 [ ok ]
 * Stopping LVM monitoring for VG syssdb9: ...
  6 logical volume(s) in volume group "syssdb9" unmonitored
 [ ok ]
 * Stopping LVM monitoring for VG syssdc1: ...
  6 logical volume(s) in volume group "syssdc1" unmonitored
 [ ok ]
 * Stopping LVM monitoring for VG syssdc3: ...
  6 logical volume(s) in volume group "syssdc3" unmonitored
 [ ok ]
 * Stopping LVM monitoring for VG syssdc6: ...
  6 logical volume(s) in volume group "syssdc6" unmonitored
 [ ok ]
 * Stopping LVM monitoring for VG syssdc7: ...
  6 logical volume(s) in volume group "syssdc7" unmonitored
 [ ok ]
 * Stopping LVM monitoring for VG vgsda11: ...
  1 logical volume(s) in volume group "vgsda11" unmonitored
 [ ok ]
 * Stopping LVM monitoring for VG vgsda15: ...
  3 logical volume(s) in volume group "vgsda15" unmonitored
 [ ok ]
 * Stopping LVM monitoring for VG vgsdb7: ...
  2 logical volume(s) in volume group "vgsdb7" unmonitored
 [ ok ]
 * Stopping LVM monitoring for VG vgsdc10: ...
  3 logical volume(s) in volume group "vgsdc10" unmonitored
 [ ok ]
 * Stopping LVM monitoring for VG vgsdc2: ...
  1 logical volume(s) in volume group "vgsdc2" unmonitored
 [ ok ]

With patch:
 * Stopping LVM monitoring for VGs   syssda10 syssda12 syssdb10 syssdb11 syssdb6 syssdb8 syssdb9 syssdc1 syssdc3 syssdc6 syssdc7 vgsda11 vgsda15 vgsdb7 vgsdc10 vgsdc2: ...
  6 logical volume(s) in volume group "syssda10" monitored
  6 logical volume(s) in volume group "syssda12" monitored
  7 logical volume(s) in volume group "syssdb10" monitored
  7 logical volume(s) in volume group "syssdb11" monitored
  6 logical volume(s) in volume group "syssdb6" monitored
  6 logical volume(s) in volume group "syssdb8" monitored
  6 logical volume(s) in volume group "syssdb9" monitored
  6 logical volume(s) in volume group "syssdc1" monitored
  6 logical volume(s) in volume group "syssdc3" monitored
  6 logical volume(s) in volume group "syssdc6" monitored
  6 logical volume(s) in volume group "syssdc7" monitored
  1 logical volume(s) in volume group "vgsda11" monitored
  3 logical volume(s) in volume group "vgsda15" monitored
  2 logical volume(s) in volume group "vgsdb7" monitored
  3 logical volume(s) in volume group "vgsdc10" monitored
  1 logical volume(s) in volume group "vgsdc2" monitored
 [ ok ]
Comment 3 Norman Back 2012-12-23 09:39:47 UTC
Created attachment 333104 [details]
corrected patch
Comment 4 Norman Back 2012-12-23 09:48:04 UTC
Corrected rc.log ouput:

With patch start:

* Starting LVM monitoring for VGs   syssda10 syssda12 syssdb10 syssdb11 syssdb6 syssdb8 syssdb9 syssdc1 syssdc3 syssdc6 syssdc7 vgsda11 vgsda15 vgsdb7 vgsdc10 vgsdc2: ...
  6 logical volume(s) in volume group "syssda10" monitored
  6 logical volume(s) in volume group "syssda12" monitored
  7 logical volume(s) in volume group "syssdb10" monitored
  7 logical volume(s) in volume group "syssdb11" monitored
  6 logical volume(s) in volume group "syssdb6" monitored
  6 logical volume(s) in volume group "syssdb8" monitored
  6 logical volume(s) in volume group "syssdb9" monitored
  6 logical volume(s) in volume group "syssdc1" monitored
  6 logical volume(s) in volume group "syssdc3" monitored
  6 logical volume(s) in volume group "syssdc6" monitored
  6 logical volume(s) in volume group "syssdc7" monitored
  1 logical volume(s) in volume group "vgsda11" monitored
  3 logical volume(s) in volume group "vgsda15" monitored
  2 logical volume(s) in volume group "vgsdb7" monitored
  3 logical volume(s) in volume group "vgsdc10" monitored
  1 logical volume(s) in volume group "vgsdc2" monitored
 [ ok ]

With patch stop:

* Stopping LVM monitoring for VGs   syssda10 syssda12 syssdb10 syssdb11 syssdb6 syssdb8 syssdb9 syssdc1 syssdc3 syssdc6 syssdc7 vgsda11 vgsda15 vgsdb7 vgsdc10 vgsdc2: ...
  6 logical volume(s) in volume group "syssda10" unmonitored
  6 logical volume(s) in volume group "syssda12" unmonitored
  7 logical volume(s) in volume group "syssdb10" unmonitored
  7 logical volume(s) in volume group "syssdb11" unmonitored
  6 logical volume(s) in volume group "syssdb6" unmonitored
  6 logical volume(s) in volume group "syssdb8" unmonitored
  6 logical volume(s) in volume group "syssdb9" unmonitored
  6 logical volume(s) in volume group "syssdc1" unmonitored
  6 logical volume(s) in volume group "syssdc3" unmonitored
  6 logical volume(s) in volume group "syssdc6" unmonitored
  6 logical volume(s) in volume group "syssdc7" unmonitored
  1 logical volume(s) in volume group "vgsda11" unmonitored
  3 logical volume(s) in volume group "vgsda15" unmonitored
  2 logical volume(s) in volume group "vgsdb7" unmonitored
  3 logical volume(s) in volume group "vgsdc10" unmonitored
  1 logical volume(s) in volume group "vgsdc2" unmonitored
 [ ok ]
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-02-02 19:51:33 UTC
InCVS 2.02.105-r2