1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-25 21:57:45 +03:00

tests: aux support throttling of dm mirror

Usage of dm_delay looks to be slowing not just 'delayed' portion
of device, but due to the fact it's also slows down ANY flush
operation on such device it's overal speed impact is huge.

In some case we can however user other methods to slowdown disk writes,
in case of old dm 'mirror'  target we can throttle  I/O of mirror
synchronisation giving the next commands enough time to test couple
race conditions.

Usage:

throttle_dm_mirror [percentage]

Thtrottle down sync speed (lowest is '1' which is also default when
unspecified)

restore_dm_mirror

Restores the value of throttling before call of  'throttle_dm_mirror'
Usually it should '100'
This commit is contained in:
Zdenek Kabelac 2018-05-07 11:39:28 +02:00
parent 0cadfdd69d
commit 172d8fb355

View File

@ -503,6 +503,7 @@ teardown_devs() {
udev_wait
}
}
restore_dm_mirror
}
kill_sleep_kill_() {
@ -1054,6 +1055,22 @@ enable_dev() {
done
}
# Throttle down performance of kcopyd when mirroring i.e. disk image
throttle_sys="/sys/module/dm_mirror/parameters/raid1_resync_throttle"
throttle_dm_mirror() {
test -f THROTTLE || cat "$throttle_sys" > THROTTLE
echo ${1-1} > "$throttle_sys"
}
# Restore original kcopyd throttle value and have mirroring fast again
restore_dm_mirror() {
test ! -f THROTTLE || {
cat THROTTLE > "$throttle_sys"
rm -f THROTTLE
}
}
# Once there is $name.devtable
# this is a quick way to restore to this table entry
restore_from_devtable() {