linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] [PATCH] tests: use correct RA size, underly dev & delay time.
@ 2020-08-12 11:18 Zhao Heming
  2020-08-12 13:32 ` heming.zhao
  0 siblings, 1 reply; 3+ messages in thread
From: Zhao Heming @ 2020-08-12 11:18 UTC (permalink / raw)
  To: linux-lvm; +Cc: Zhao Heming

lvconvert-repair-raid.sh:
- in some env, the delay=0 is too short to set up env.

lvcreate-usage.sh:
- use correct underlying dev for brd & loop devices.
- read ahead size should equal or bigger than current system value

read-ahead.sh:
- use current system ra_size PLUS 128 to set up new ra_size.
  for detail, refer _set_dev_node_read_ahead in libdm-common.c

Signed-off-by: Zhao Heming <heming.zhao@suse.com>
---
 test/shell/lvconvert-repair-raid.sh |  2 +-
 test/shell/lvcreate-usage.sh        | 11 ++++++-----
 test/shell/read-ahead.sh            |  6 ++++--
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/test/shell/lvconvert-repair-raid.sh b/test/shell/lvconvert-repair-raid.sh
index 711f386..b2c6a6f 100644
--- a/test/shell/lvconvert-repair-raid.sh
+++ b/test/shell/lvconvert-repair-raid.sh
@@ -39,7 +39,7 @@ function delay
 RAID_SIZE=32
 
 # Fast sync and repair afterwards
-delay 0
+delay 1
 
 # RAID1 transient failure check
 lvcreate --type raid1 -m 1 -L $RAID_SIZE -n $lv1 $vg "$dev1" "$dev2"
diff --git a/test/shell/lvcreate-usage.sh b/test/shell/lvcreate-usage.sh
index 6d46939..4102a2c 100644
--- a/test/shell/lvcreate-usage.sh
+++ b/test/shell/lvcreate-usage.sh
@@ -178,18 +178,19 @@ check lv_field $vg/$lv3 lv_kernel_read_ahead "8.00k"
 lvcreate -L 8 -n $lv4 --readahead auto $vg "$dev1"
 check lv_field $vg/$lv4 lv_read_ahead "auto"
 # figure RA value of a PV origin device
-DEVICE=$(dmsetup deps -o blkdevname "$dev1" | sed -e "s,.*:\ (\(.*\)),/dev/\1,")
+DEVICE=$dev1
 RASZ=$(( $(blockdev --getra "$DEVICE" ) / 2 ))
 test "$RASZ" -ge 128 || RASZ="128"
 check lv_field $vg/$lv4 lv_kernel_read_ahead "${RASZ}.00k" --units k
 lvcreate -vvvvv -L 8 -n $lv5 -i2 --stripesize 16k --readahead auto $vg
 check lv_field $vg/$lv5 lv_read_ahead "auto"
-# For 16k stripe we set '128k' as the is the minimum size we get when creating DM device
-check lv_field $vg/$lv5 lv_kernel_read_ahead "128.00k" --units k
-lvcreate -L 8 -n $lv6 -i2 --stripesize 128k --readahead auto $vg
+# For 16k stripe we set '$RASZ' as the is the minimum size we get when creating DM device
+check lv_field $vg/$lv5 lv_kernel_read_ahead "${RASZ}.00k" --units k
+lvcreate -L 8 -n $lv6 -i2 --stripesize "${RASZ}"k --readahead auto $vg
 check lv_field $vg/$lv6 lv_read_ahead "auto"
 # For striped device we set double of strip size unrelated to underlaying dev RA size
-check lv_field $vg/$lv6 lv_kernel_read_ahead "512.00k" --units k
+RASZ=$(expr ${RASZ} \* 4)
+check lv_field $vg/$lv6 lv_kernel_read_ahead "${RASZ}.00k" --units k
 lvremove -ff $vg
 
 #
diff --git a/test/shell/read-ahead.sh b/test/shell/read-ahead.sh
index 2f061fa..46a88e6 100644
--- a/test/shell/read-ahead.sh
+++ b/test/shell/read-ahead.sh
@@ -33,11 +33,13 @@ check lv_field $vg/$lv lv_read_ahead 640 --units s --nosuffix
 lvremove -ff $vg
 
 #COMM "read ahead is properly inherited from underlying PV"
-blockdev --setra 768 "$dev1"
+SET_RA=$(blockdev --getra "$dev1")
+SET_RA=$(expr ${SET_RA} + 128)
+blockdev --setra ${SET_RA} "$dev1"
 vgscan
 # is there something in the system changing readahead settings behind the scene...
 RASZ=$(blockdev --getra "$dev1")
-test "$RASZ" -ge 768 || RASZ=768
+test "$RASZ" -ge SET_RA || RASZ=${SET_RA}
 lvcreate -n $lv -L4m $vg "$dev1"
 test "$(blockdev --getra "$DM_DEV_DIR/$vg/$lv")" -eq "$RASZ"
 lvremove -ff $vg
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-lvm] [PATCH] tests: use correct RA size, underly dev & delay time.
  2020-08-12 11:18 [linux-lvm] [PATCH] tests: use correct RA size, underly dev & delay time Zhao Heming
@ 2020-08-12 13:32 ` heming.zhao
  2020-08-13 19:01   ` Zdenek Kabelac
  0 siblings, 1 reply; 3+ messages in thread
From: heming.zhao @ 2020-08-12 13:32 UTC (permalink / raw)
  To: linux-lvm

a little more info about my patch.
in one of my test env, system default read_ahead size is 1024 sector (512K), 
which bigger than 128k in test case. which causes _set_dev_node_read_ahead() to deny
to set up RA.

On 8/12/20 7:18 PM, Zhao Heming wrote:
> lvconvert-repair-raid.sh:
> - in some env, the delay=0 is too short to set up env.
> 
> lvcreate-usage.sh:
> - use correct underlying dev for brd & loop devices.
> - read ahead size should equal or bigger than current system value
> 
> read-ahead.sh:
> - use current system ra_size PLUS 128 to set up new ra_size.
>    for detail, refer _set_dev_node_read_ahead in libdm-common.c
> 
> Signed-off-by: Zhao Heming <heming.zhao@suse.com>
> ---
>   test/shell/lvconvert-repair-raid.sh |  2 +-
>   test/shell/lvcreate-usage.sh        | 11 ++++++-----
>   test/shell/read-ahead.sh            |  6 ++++--
>   3 files changed, 11 insertions(+), 8 deletions(-)
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-lvm] [PATCH] tests: use correct RA size, underly dev & delay time.
  2020-08-12 13:32 ` heming.zhao
@ 2020-08-13 19:01   ` Zdenek Kabelac
  0 siblings, 0 replies; 3+ messages in thread
From: Zdenek Kabelac @ 2020-08-13 19:01 UTC (permalink / raw)
  To: LVM general discussion and development, heming.zhao

Dne 12. 08. 20 v 15:32 heming.zhao@suse.com napsal(a):
> a little more info about my patch.
> in one of my test env, system default read_ahead size is 1024 sector (512K),
> which bigger than 128k in test case. which causes _set_dev_node_read_ahead() to deny
> to set up RA.
> 

Hi

Yeah - RA testing is a bit tricky - we had some issues whit systems 
interfering with 'tuned' on RHEL which has been changing RA after
device creation.

We did same adaptation of other tests to handle multiple possible values.

I'll check what this test is doing.

Zdenek

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-13 19:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-12 11:18 [linux-lvm] [PATCH] tests: use correct RA size, underly dev & delay time Zhao Heming
2020-08-12 13:32 ` heming.zhao
2020-08-13 19:01   ` Zdenek Kabelac

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).