master - tests: use DIRECT io for zeroing whenver we can
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f2878a801c7af73e9110650708f7fd741c22c3d2 Commit: f2878a801c7af73e9110650708f7fd741c22c3d2 Parent: 531a475afcc602d573581eb11ecc572e427f0f35 Author: Zdenek Kabelac <[email protected]> AuthorDate: Sat Sep 19 23:25:11 2020 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Sun Sep 20 00:37:21 2020 +0200
tests: use DIRECT io for zeroing whenver we can
Performance with direct I/O here is noticable better, so use it instead of buffered write whenever we can.
--- test/shell/integrity-blocksize.sh | 15 ++-- test/shell/integrity.sh | 10 +-- test/shell/lvchange-cache-mode.sh | 4 +- test/shell/lvcreate-thin-big.sh | 2 +- test/shell/metadata-bad-mdaheader.sh | 8 +-- test/shell/pvck-dump.sh | 20 +++--- test/shell/pvck-repair.sh | 135 +++++++++++++---------------------- test/shell/pvcreate-operation.sh | 2 +- test/shell/select-report.sh | 4 +- test/shell/snapshot-maxsize.sh | 2 +- test/shell/snapshot-merge-thin.sh | 2 +- test/shell/thin-dmeventd-warns.sh | 8 +-- test/shell/thin-flags.sh | 4 +- test/shell/thin-many-dmeventd.sh | 4 +- test/shell/vg-check-devs-used.sh | 4 +- 15 files changed, 97 insertions(+), 127 deletions(-)
test/shell/integrity-blocksize.sh +11 -4
@@ -46,10 +46,17 @@ vgremove -ff $vg trap 'cleanup_mounted_and_teardown' EXIT -dd if=/dev/zero of=loopa bs=$((1024*1024)) count=64 2> /dev/null -dd if=/dev/zero of=loopb bs=$((1024*1024)) count=64 2> /dev/null -dd if=/dev/zero of=loopc bs=$((1024*1024)) count=64 2> /dev/null -dd if=/dev/zero of=loopd bs=$((1024*1024)) count=64 2> /dev/null +# Currently (5.9-rc5 hits 'blkdev_issue_discard()' kernel WARNING) +#truncate -s 64M loopa +#truncate -s 64M loopb +#truncate -s 64M loopc +#truncate -s 64M loopd + +dd if=/dev/zero of=loopa bs=1M count=64 oflag=sync +dd if=/dev/zero of=loopb bs=1M count=64 oflag=sync +dd if=/dev/zero of=loopc bs=1M count=64 oflag=sync +dd if=/dev/zero of=loopd bs=1M count=64 oflag=sync + LOOP1=$(losetup -f loopa --show) LOOP2=$(losetup -f loopb --show) LOOP3=$(losetup -f loopc --sector-size 4096 --show)
test/shell/integrity.sh +5 -5
@@ -37,11 +37,11 @@ dd if=/dev/urandom of=randC bs=512K count=4 _prepare_vg() { # zero devs so we are sure to find the correct file data # on the underlying devs when corrupting it - dd if=/dev/zero of="$dev1" bs=1M || true - dd if=/dev/zero of="$dev2" bs=1M || true - dd if=/dev/zero of="$dev3" bs=1M || true - dd if=/dev/zero of="$dev4" bs=1M || true - dd if=/dev/zero of="$dev5" bs=1M || true + dd if=/dev/zero of="$dev1" bs=1M oflag=direct || true + dd if=/dev/zero of="$dev2" bs=1M oflag=direct || true + dd if=/dev/zero of="$dev3" bs=1M oflag=direct || true + dd if=/dev/zero of="$dev4" bs=1M oflag=direct || true + dd if=/dev/zero of="$dev5" bs=1M oflag=direct || true vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" pvs }
test/shell/lvchange-cache-mode.sh +2 -2
@@ -32,9 +32,9 @@ lvcreate -H -L14 -n $lv1 --cachemode writeback --cachesettings migration_thresho for i in $(seq 1 10) ; do echo 3 >/proc/sys/vm/drop_caches -dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv1" bs=64K count=20 conv=fdatasync || true +dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv1" bs=64K count=20 oflag=direct || true echo 3 >/proc/sys/vm/drop_caches -dd if="$DM_DEV_DIR/$vg/$lv1" of=/dev/null bs=64K count=20 || true +dd if="$DM_DEV_DIR/$vg/$lv1" of=/dev/null bs=64K count=20 oflag=direct || true done lvs -o+cache_dirty_blocks,cache_read_hits,cache_read_misses,cache_write_hits,cache_write_misses $vg/$lv1
test/shell/lvcreate-thin-big.sh +1 -1
@@ -49,7 +49,7 @@ lvcreate -V10G $vg/pool3 -n $lv1 lvcreate -V2G $vg/pool3 -n $lv2 dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv1" bs=512b count=1 conv=fdatasync # ...excercise write speed to 'zero' device ;) -dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv2" bs=64K count=32767 conv=fdatasync +dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv2" bs=64K count=32767 oflag=direct lvs -a $vg # Check the percentage is not shown as 0.00 check lv_field $vg/$lv1 data_percent "0.01"
test/shell/metadata-bad-mdaheader.sh +3 -5
@@ -27,9 +27,9 @@ get_devs # is needed. # -dd if=/dev/zero of="$dev1" || true -dd if=/dev/zero of="$dev2" || true -dd if=/dev/zero of="$dev3" || true +dd if=/dev/zero of="$dev1" bs=1M count=1 oflag=direct +dd if=/dev/zero of="$dev2" bs=1M count=1 oflag=direct +dd if=/dev/zero of="$dev3" bs=1M count=1 oflag=direct vgcreate $SHARED $vg "$dev1" "$dev2" "$dev3"
@@ -74,5 +74,3 @@ pvs "$dev3" vgchange -an $vg vgremove -ff $vg - -
test/shell/pvck-dump.sh +10 -10
@@ -17,11 +17,11 @@ SIZE_MB=80 aux prepare_devs 4 $SIZE_MB get_devs -dd if=/dev/zero of="$dev1" bs=1M count=2 conv=fdatasync -dd if=/dev/zero of="$dev2" bs=1M count=2 conv=fdatasync +dd if=/dev/zero of="$dev1" bs=1M count=2 oflag=direct +dd if=/dev/zero of="$dev2" bs=1M count=2 oflag=direct # clear entire dev to cover mda2 -dd if=/dev/zero of="$dev3" bs=1M count=$SIZE_MB conv=fdatasync -dd if=/dev/zero of="$dev4" bs=1M count=2 conv=fdatasync +dd if=/dev/zero of="$dev3" bs=1M count=$SIZE_MB oflag=direct +dd if=/dev/zero of="$dev4" bs=1M count=2 oflag=direct pvcreate "$dev1" pvcreate "$dev2"
@@ -136,10 +136,10 @@ vgremove -ff $vg # clear entire dev to cover mda2 -dd if=/dev/zero of="$dev1" bs=1M count=$SIZE_MB conv=fdatasync -dd if=/dev/zero of="$dev2" bs=1M count=32 conv=fdatasync -dd if=/dev/zero of="$dev3" bs=1M count=32 conv=fdatasync -dd if=/dev/zero of="$dev4" bs=1M count=32 conv=fdatasync +dd if=/dev/zero of="$dev1" bs=1M count=$SIZE_MB oflag=direct +dd if=/dev/zero of="$dev2" bs=1M count=32 oflag=direct +dd if=/dev/zero of="$dev3" bs=1M count=32 oflag=direct +dd if=/dev/zero of="$dev4" bs=1M count=32 oflag=direct pvcreate --pvmetadatacopies 2 --metadatasize 32M "$dev1"
@@ -160,7 +160,7 @@ dd if="$dev1" of=dev1dd bs=1M count=34 # Clear the header so that we force metadata_search to use # the settings instead of getting the mda_size/mda_offset # from the headers. -dd if=/dev/zero of="$dev1" bs=4K count=1 +dd if=/dev/zero of="$dev1" bs=4K count=1 oflag=direct # Warning: these checks are based on copying specific numbers # seen when running these commands, but these numbers could
@@ -192,6 +192,6 @@ grep "seqno 477" m1b grep "seqno 478" m1b grep "seqno 500" m2 -dd if=dev1dd of="$dev1" bs=4K count=1 +dd if=dev1dd of="$dev1" bs=4K count=1 oflag=direct vgremove -ff $vg
test/shell/pvck-repair.sh +50 -85
297 lines not on this page · raw message
test/shell/pvcreate-operation.sh +1 -1
@@ -181,7 +181,7 @@ grep "Not enough space available for metadata area with index 1 on PV $dev1" err rm -f "$backupfile" # pvcreate wipes swap signature when forced -dd if=/dev/zero of="$dev1" bs=1024 count=64 +dd if=/dev/zero of="$dev1" bs=64k count=1 oflag=direct mkswap "$dev1" blkid -c /dev/null "$dev1" | grep "swap" pvcreate -f "$dev1"
test/shell/select-report.sh +2 -2
@@ -152,11 +152,11 @@ if aux target_at_least dm-snapshot 1 10 0; then # Before 1.10.0, the snap percent included metadata size. sel lv 'snap_percent=0' snap fi -dd if=/dev/zero of="$DM_DEV_DIR/$vg3/snap" bs=1M count=1 conv=fdatasync +dd if=/dev/zero of="$DM_DEV_DIR/$vg3/snap" bs=1M count=1 oflag=direct sel lv 'snap_percent<50' snap sel lv 'snap_percent>50' # overflow snapshot -> invalidated, but still showing 100% -not dd if=/dev/zero of="$DM_DEV_DIR/$vg3/snap" bs=1M count=4 conv=fdatasync +not dd if=/dev/zero of="$DM_DEV_DIR/$vg3/snap" bs=1M count=4 oflag=direct sel lv 'snap_percent=100' snap # % char is accepted as suffix for percent values sel lv 'snap_percent=100%' snap
test/shell/snapshot-maxsize.sh +1 -1
@@ -27,7 +27,7 @@ lvcreate -aey -L1 -n $lv1 $vg # Snapshot should be large enough to handle any writes lvcreate -L2 -s $vg/$lv1 -n $lv2 -dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv2" bs=1M count=1 conv=fdatasync +dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv2" bs=1M count=1 oflag=direct # Snapshot must not be 'I'nvalid here check lv_attr_bit state $vg/$lv2 "a"
test/shell/snapshot-merge-thin.sh +1 -1
@@ -23,7 +23,7 @@ aux prepare_vg 2 lvcreate -T -L1 -V1 -n $lv1 $vg/pool "$dev1" lvcreate -s -n $lv2 -L2 $vg/$lv1 "$dev2" -dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv2" bs=1M count=1 conv=fdatasync +dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv2" bs=1M count=1 oflag=direct # Initiate background merge lvconvert -b --merge $vg/$lv2
test/shell/thin-dmeventd-warns.sh +4 -4
@@ -44,19 +44,19 @@ aux prepare_vg lvcreate -L8 -V8 -T $vg/pool -n $lv1 -dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv1" bs=256K count=26 +dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv1" bs=256K count=26 oflag=direct test "$(percent_)" -gt 80 # Give it some time to dmeventd to log WARNING wait_warn_ 1 -dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv1" bs=256K count=30 +dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv1" bs=256K count=30 oflag=direct test "$(percent_)" -gt 90 # Give it some time to dmeventd to log WARNING wait_warn_ 2 -dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv1" bs=1M count=8 +dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv1" bs=1M count=8 oflag=direct test "$(percent_)" -eq 100 wait_warn_ 3
@@ -71,7 +71,7 @@ sleep 11 # below 'WARNED' threshold. -dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv1" bs=256K count=30 +dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv1" bs=256K count=30 oflag=direct test "$(percent_)" -gt 90 lvs -a $vg
test/shell/thin-flags.sh +2 -2
@@ -47,7 +47,7 @@ lvchange -an $vg # Overfill data area lvchange -ay $vg -dd if=/dev/zero of="$DM_DEV_DIR/mapper/$vg-$lv2" bs=1M count=2 +dd if=/dev/zero of="$DM_DEV_DIR/mapper/$vg-$lv2" bs=1M count=2 oflag=direct check lv_attr_bit health $vg/pool "D" # TODO use spaces ?? check lv_field $vg/pool lv_health_status "out_of_data"
@@ -78,7 +78,7 @@ lvchange -ay $vg lvchange -ay $vg/$lv2 # Provisiong and last free bits in metadata -dd if=/dev/zero of="$DM_DEV_DIR/mapper/$vg-$lv2" bs=32K count=1 +dd if=/dev/zero of="$DM_DEV_DIR/mapper/$vg-$lv2" bs=32K count=1 oflag=direct check lv_attr_bit health $vg/pool "M" # TODO - use spaces ??
test/shell/thin-many-dmeventd.sh +2 -2
@@ -34,7 +34,7 @@ for i in $(seq 1 5) do lvcreate --errorwhenfull y -Zn -T -L4M -V4M $vg/pool_${i} -n $lv${i} # Fill thin-pool to some capacity >50% - dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv${i}" bs=256K count=9 conv=fdatasync + dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv${i}" bs=256K count=9 oflag=direct done lvs -a $vg
@@ -63,7 +63,7 @@ do DIFF=$(( END - START )) test "$DIFF" -lt 8 || die "Creation of thin pool took more then 8 second! ($DIFF seconds)" # Fill thin-pool to some capacity >50% - dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv${i}" bs=256K count=9 conv=fdatasync + dd if=/dev/zero of="$DM_DEV_DIR/$vg/$lv${i}" bs=256K count=9 oflag=direct done vgremove -f $vg
test/shell/vg-check-devs-used.sh +2 -2
@@ -22,11 +22,11 @@ aux prepare_devs 3 8 vgcreate $SHARED "$vg" "$dev1" "$dev2" lvcreate -l100%FREE -n $lv $vg -dd if="$dev1" of="$dev3" bs=1M +dd if="$dev1" of="$dev3" bs=1M oflag=direct pvs --config "devices/global_filter = [ \"a|$dev2|\", \"a|$dev3|\", \"r|.*|\" ]" 2>err grep "WARNING: Device mismatch detected for $vg/$lv which is accessing $dev1 instead of $dev3" err -dd if=/dev/zero of="$dev3" bs=1M count=8 +dd if=/dev/zero of="$dev3" bs=1M count=8 oflag=direct lvremove -ff $vg # Also test if sub LVs with suffixes are correctly processed.