* [PATCH 1/3] blktests: nvme: skip passthru tests on multipath devices
@ 2024-08-22 19:38 Martin Wilck
2024-08-22 19:38 ` [PATCH 2/3] blktests: nvme/032: skip on non-PCI devices Martin Wilck
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Martin Wilck @ 2024-08-22 19:38 UTC (permalink / raw)
To: Shin'ichiro Kawasaki
Cc: Chaitanya Kulkarni, Hannes Reinecke, Daniel Wagner, linux-block,
linux-nvme, Martin Wilck
NVMe multipath devices have no associated character device that
can be used for NVMe passtrhu. Skip them.
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
tests/nvme/033 | 4 ++++
tests/nvme/034 | 4 ++++
tests/nvme/035 | 1 +
tests/nvme/036 | 4 ++++
tests/nvme/037 | 4 ++++
tests/nvme/039 | 4 ++++
tests/nvme/rc | 8 ++++++++
7 files changed, 29 insertions(+)
diff --git a/tests/nvme/033 b/tests/nvme/033
index 7a69b94..dda0763 100755
--- a/tests/nvme/033
+++ b/tests/nvme/033
@@ -13,6 +13,10 @@ requires() {
_have_kernel_option NVME_TARGET_PASSTHRU
}
+device_requires() {
+ _require_test_dev_is_nvme_no_mpath
+}
+
set_conditions() {
_set_nvme_trtype "$@"
}
diff --git a/tests/nvme/034 b/tests/nvme/034
index 239757c..41f1542 100755
--- a/tests/nvme/034
+++ b/tests/nvme/034
@@ -14,6 +14,10 @@ requires() {
_have_fio
}
+device_requires() {
+ _require_test_dev_is_nvme_no_mpath
+}
+
set_conditions() {
_set_nvme_trtype "$@"
}
diff --git a/tests/nvme/035 b/tests/nvme/035
index 8286178..4357efa 100755
--- a/tests/nvme/035
+++ b/tests/nvme/035
@@ -17,6 +17,7 @@ requires() {
}
device_requires() {
+ _require_test_dev_is_nvme_no_mpath
_require_test_dev_size "${NVME_IMG_SIZE}"
}
diff --git a/tests/nvme/036 b/tests/nvme/036
index ef6c29d..3a28cb7 100755
--- a/tests/nvme/036
+++ b/tests/nvme/036
@@ -13,6 +13,10 @@ requires() {
_have_kernel_option NVME_TARGET_PASSTHRU
}
+device_requires() {
+ _require_test_dev_is_nvme_no_mpath
+}
+
set_conditions() {
_set_nvme_trtype "$@"
}
diff --git a/tests/nvme/037 b/tests/nvme/037
index ef7ac59..557d491 100755
--- a/tests/nvme/037
+++ b/tests/nvme/037
@@ -12,6 +12,10 @@ requires() {
_have_kernel_option NVME_TARGET_PASSTHRU
}
+device_requires() {
+ _require_test_dev_is_nvme_no_mpath
+}
+
set_conditions() {
_set_nvme_trtype "$@"
}
diff --git a/tests/nvme/039 b/tests/nvme/039
index a0f135c..ff8c1eb 100755
--- a/tests/nvme/039
+++ b/tests/nvme/039
@@ -18,6 +18,10 @@ requires() {
_have_kernel_option FAULT_INJECTION_DEBUG_FS
}
+device_requires() {
+ _require_test_dev_is_nvme_no_mpath
+}
+
# Get the last dmesg lines as many as specified. Exclude the lines to indicate
# suppression by rate limit.
last_dmesg()
diff --git a/tests/nvme/rc b/tests/nvme/rc
index dedc412..b3b1149 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -130,6 +130,14 @@ _require_test_dev_is_nvme() {
return 0
}
+_require_test_dev_is_nvme_no_mpath() {
+ if [[ "$(readlink -f "$TEST_DEV_SYSFS/device")" =~ /nvme-subsystem/ ]]; then
+ SKIP_REASONS+=("$TEST_DEV is a NVMe multipath device")
+ return 1
+ fi
+ return 0
+}
+
_require_nvme_test_img_size() {
local require_sz_mb
local nvme_img_size_mb
--
2.46.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 2/3] blktests: nvme/032: skip on non-PCI devices
2024-08-22 19:38 [PATCH 1/3] blktests: nvme: skip passthru tests on multipath devices Martin Wilck
@ 2024-08-22 19:38 ` Martin Wilck
2024-08-23 6:46 ` Daniel Wagner
2024-08-22 19:38 ` [PATCH 3/3] nvme: add test for controller rescan under I/O load Martin Wilck
2024-08-23 6:35 ` [PATCH 1/3] blktests: nvme: skip passthru tests on multipath devices Daniel Wagner
2 siblings, 1 reply; 13+ messages in thread
From: Martin Wilck @ 2024-08-22 19:38 UTC (permalink / raw)
To: Shin'ichiro Kawasaki
Cc: Chaitanya Kulkarni, Hannes Reinecke, Daniel Wagner, linux-block,
linux-nvme, Martin Wilck
nvme/032 is a PCI-specific test.
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
tests/nvme/032 | 2 +-
tests/nvme/rc | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/tests/nvme/032 b/tests/nvme/032
index 5353e96..512d7ea 100755
--- a/tests/nvme/032
+++ b/tests/nvme/032
@@ -24,7 +24,7 @@ requires() {
}
device_requires() {
- _require_test_dev_is_nvme
+ _require_test_dev_is_nvme_pci
}
test_device() {
diff --git a/tests/nvme/rc b/tests/nvme/rc
index b3b1149..e7d2ab1 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -130,6 +130,14 @@ _require_test_dev_is_nvme() {
return 0
}
+_require_test_dev_is_nvme_pci() {
+ if [[ ! "$(readlink -f "$TEST_DEV_SYSFS/device")" =~ devices/pci ]]; then
+ SKIP_REASONS+=("$TEST_DEV is not a PCI NVMe device")
+ return 1
+ fi
+ return 0
+}
+
_require_test_dev_is_nvme_no_mpath() {
if [[ "$(readlink -f "$TEST_DEV_SYSFS/device")" =~ /nvme-subsystem/ ]]; then
SKIP_REASONS+=("$TEST_DEV is a NVMe multipath device")
--
2.46.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 3/3] nvme: add test for controller rescan under I/O load
2024-08-22 19:38 [PATCH 1/3] blktests: nvme: skip passthru tests on multipath devices Martin Wilck
2024-08-22 19:38 ` [PATCH 2/3] blktests: nvme/032: skip on non-PCI devices Martin Wilck
@ 2024-08-22 19:38 ` Martin Wilck
2024-08-23 6:45 ` Daniel Wagner
2024-08-23 10:18 ` Nilay Shroff
2024-08-23 6:35 ` [PATCH 1/3] blktests: nvme: skip passthru tests on multipath devices Daniel Wagner
2 siblings, 2 replies; 13+ messages in thread
From: Martin Wilck @ 2024-08-22 19:38 UTC (permalink / raw)
To: Shin'ichiro Kawasaki
Cc: Chaitanya Kulkarni, Hannes Reinecke, Daniel Wagner, linux-block,
linux-nvme, Martin Wilck
Add a test that repeatedly rescans nvme controllers while doing IO
on an nvme namespace connected to these controllers. The purpose
of the test is to make sure that no I/O errors or data corruption
occurs because of the rescan operations.
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
tests/nvme/053 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++
tests/nvme/rc | 18 ++++++++++++++++
2 files changed, 74 insertions(+)
create mode 100755 tests/nvme/053
diff --git a/tests/nvme/053 b/tests/nvme/053
new file mode 100755
index 0000000..41dc8f2
--- /dev/null
+++ b/tests/nvme/053
@@ -0,0 +1,56 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2024 Martin Wilck, SUSE LLC
+
+. tests/nvme/rc
+
+DESCRIPTION="test controller rescan under I/O load"
+TIMED=1
+: "${TIMEOUT:=60}"
+
+rescan_controller() {
+ local finish
+
+ [[ -f "$1/rescan_controller" ]] || {
+ echo "cannot rescan $1"
+ return 1
+ }
+
+ finish=$(($(date +%s) + TIMEOUT))
+ while [[ $(date +%s) -le $finish ]]; do
+ # sleep interval between 0.1 and 5s
+ usleep "$(((RANDOM%50 + 1)*100000))"
+ echo 1 >"$1/rescan_controller"
+ done
+}
+
+test_device() {
+ local -a ctrls
+ local c
+
+ echo "Running ${TEST_NAME}"
+ ctrls=($(_nvme_get_ctrl_list))
+
+ _run_fio_verify_io --filename="$TEST_DEV" --time_based &> "$FULL" &
+
+ for c in "${ctrls[@]}"; do
+ rescan_controller "$c" &
+ done
+
+ while true; do
+ wait -n &>/dev/null
+ st=$?
+ case $st in
+ 127)
+ break
+ ;;
+ 0)
+ ;;
+ *)
+ echo "child process exited with $st!"
+ ;;
+ esac
+ done
+
+ echo "Test complete"
+}
diff --git a/tests/nvme/rc b/tests/nvme/rc
index e7d2ab1..93b0571 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -192,6 +192,24 @@ _test_dev_nvme_nsid() {
cat "${TEST_DEV_SYSFS}/nsid"
}
+_nvme_get_ctrl_list() {
+ local subsys
+ local c
+
+ subsys=$(readlink "${TEST_DEV_SYSFS}/device/subsystem")
+ case $subsys in
+ */nvme)
+ readlink -f "${TEST_DEV_SYSFS}/device"
+ ;;
+ */nvme-subsystem)
+ for c in "${TEST_DEV_SYSFS}"/device/nvme*; do
+ [[ -L "$c" ]] || continue
+ [[ -f "$c/dev" ]] && readlink -f "$c"
+ done
+ ;;
+ esac
+}
+
_nvme_calc_rand_io_size() {
local img_size_mb
local io_size_kb
--
2.46.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH 3/3] nvme: add test for controller rescan under I/O load
2024-08-22 19:38 ` [PATCH 3/3] nvme: add test for controller rescan under I/O load Martin Wilck
@ 2024-08-23 6:45 ` Daniel Wagner
2024-08-23 6:50 ` Martin Wilck
2024-08-23 10:18 ` Nilay Shroff
1 sibling, 1 reply; 13+ messages in thread
From: Daniel Wagner @ 2024-08-23 6:45 UTC (permalink / raw)
To: Martin Wilck
Cc: Shin'ichiro Kawasaki, Chaitanya Kulkarni, Hannes Reinecke,
linux-block, linux-nvme, Martin Wilck
On Thu, Aug 22, 2024 at 09:38:14PM GMT, Martin Wilck wrote:
> Add a test that repeatedly rescans nvme controllers while doing IO
> on an nvme namespace connected to these controllers. The purpose
> of the test is to make sure that no I/O errors or data corruption
> occurs because of the rescan operations.
Could you elaborate why this tests is added? Does it test for a
regression, are there any patches for this? Or is it more let's ensure
this actually works?
The code looks good.
Reviewed-by: Daniel Wagner <dwagner@suse.de>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/3] nvme: add test for controller rescan under I/O load
2024-08-23 6:45 ` Daniel Wagner
@ 2024-08-23 6:50 ` Martin Wilck
2024-08-23 7:03 ` Daniel Wagner
0 siblings, 1 reply; 13+ messages in thread
From: Martin Wilck @ 2024-08-23 6:50 UTC (permalink / raw)
To: Daniel Wagner
Cc: Shin'ichiro Kawasaki, Chaitanya Kulkarni, Hannes Reinecke,
linux-block, linux-nvme
On Fri, 2024-08-23 at 08:45 +0200, Daniel Wagner wrote:
> On Thu, Aug 22, 2024 at 09:38:14PM GMT, Martin Wilck wrote:
> > Add a test that repeatedly rescans nvme controllers while doing IO
> > on an nvme namespace connected to these controllers. The purpose
> > of the test is to make sure that no I/O errors or data corruption
> > occurs because of the rescan operations.
>
> Could you elaborate why this tests is added? Does it test for a
> regression, are there any patches for this? Or is it more let's
> ensure
> this actually works?
The rationale was to test the kernel patch that I submitted yesterday:
https://lore.kernel.org/linux-nvme/9de89e5a-04fc-4684-8514-b86884643a5d@suse.de/T/#t
Thanks,
Martin
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/3] nvme: add test for controller rescan under I/O load
2024-08-23 6:50 ` Martin Wilck
@ 2024-08-23 7:03 ` Daniel Wagner
0 siblings, 0 replies; 13+ messages in thread
From: Daniel Wagner @ 2024-08-23 7:03 UTC (permalink / raw)
To: Martin Wilck
Cc: Shin'ichiro Kawasaki, Chaitanya Kulkarni, Hannes Reinecke,
linux-block, linux-nvme
On Fri, Aug 23, 2024 at 08:50:04AM GMT, Martin Wilck wrote:
> On Fri, 2024-08-23 at 08:45 +0200, Daniel Wagner wrote:
> > On Thu, Aug 22, 2024 at 09:38:14PM GMT, Martin Wilck wrote:
> > > Add a test that repeatedly rescans nvme controllers while doing IO
> > > on an nvme namespace connected to these controllers. The purpose
> > > of the test is to make sure that no I/O errors or data corruption
> > > occurs because of the rescan operations.
> >
> > Could you elaborate why this tests is added? Does it test for a
> > regression, are there any patches for this? Or is it more let's
> > ensure
> > this actually works?
>
> The rationale was to test the kernel patch that I submitted yesterday:
> https://lore.kernel.org/linux-nvme/9de89e5a-04fc-4684-8514-b86884643a5d@suse.de/T/#t
I figured this out later too :) Just going chronology through the
inbox.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/3] nvme: add test for controller rescan under I/O load
2024-08-22 19:38 ` [PATCH 3/3] nvme: add test for controller rescan under I/O load Martin Wilck
2024-08-23 6:45 ` Daniel Wagner
@ 2024-08-23 10:18 ` Nilay Shroff
2024-08-23 13:39 ` Nilay Shroff
2024-08-23 14:49 ` Martin Wilck
1 sibling, 2 replies; 13+ messages in thread
From: Nilay Shroff @ 2024-08-23 10:18 UTC (permalink / raw)
To: Martin Wilck, Shin'ichiro Kawasaki
Cc: Chaitanya Kulkarni, Hannes Reinecke, Daniel Wagner, linux-block,
linux-nvme, Martin Wilck
On 8/23/24 01:08, Martin Wilck wrote:
> Add a test that repeatedly rescans nvme controllers while doing IO
> on an nvme namespace connected to these controllers. The purpose
> of the test is to make sure that no I/O errors or data corruption
> occurs because of the rescan operations.
>
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
> tests/nvme/053 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++
> tests/nvme/rc | 18 ++++++++++++++++
> 2 files changed, 74 insertions(+)
> create mode 100755 tests/nvme/053
>
> diff --git a/tests/nvme/053 b/tests/nvme/053
> new file mode 100755
> index 0000000..41dc8f2
> --- /dev/null
> +++ b/tests/nvme/053
> @@ -0,0 +1,56 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-3.0+
> +# Copyright (C) 2024 Martin Wilck, SUSE LLC
> +
> +. tests/nvme/rc
> +
> +DESCRIPTION="test controller rescan under I/O load"
> +TIMED=1
> +: "${TIMEOUT:=60}"
> +
> +rescan_controller() {
> + local finish
> +
> + [[ -f "$1/rescan_controller" ]] || {
> + echo "cannot rescan $1"
> + return 1
> + }
> +
> + finish=$(($(date +%s) + TIMEOUT))
> + while [[ $(date +%s) -le $finish ]]; do
> + # sleep interval between 0.1 and 5s
> + usleep "$(((RANDOM%50 + 1)*100000))"
> + echo 1 >"$1/rescan_controller"
> + done
> +}
I think here usleep may not be available by default on all systems.
For instance, on fedora/rhel I don't have usleep installed in the
defualt configuration and so I have to first install it. So you may
want to add "usleep" as per-requisite for this test. Moreover, after
I installed usleep on fedora and ran the above test I see this warning:
warning: usleep is deprecated, and will be removed in near future!
Due to above warning the test fails. So is it possible to replace
usleep with sleep?
> +
> +test_device() {
> + local -a ctrls
> + local c
> +
> + echo "Running ${TEST_NAME}"
> + ctrls=($(_nvme_get_ctrl_list))
> +
> + _run_fio_verify_io --filename="$TEST_DEV" --time_based &> "$FULL" &
> +
> + for c in "${ctrls[@]}"; do
> + rescan_controller "$c" &
> + done
> +
> + while true; do
> + wait -n &>/dev/null
> + st=$?
> + case $st in
> + 127)
> + break
> + ;;
> + 0)
> + ;;
> + *)
> + echo "child process exited with $st!"
> + ;;
> + esac
> + done
> +
> + echo "Test complete"
> +}
> diff --git a/tests/nvme/rc b/tests/nvme/rc
> index e7d2ab1..93b0571 100644
> --- a/tests/nvme/rc
> +++ b/tests/nvme/rc
> @@ -192,6 +192,24 @@ _test_dev_nvme_nsid() {
> cat "${TEST_DEV_SYSFS}/nsid"
> }
>
> +_nvme_get_ctrl_list() {
> + local subsys
> + local c
> +
> + subsys=$(readlink "${TEST_DEV_SYSFS}/device/subsystem")
> + case $subsys in
> + */nvme)
> + readlink -f "${TEST_DEV_SYSFS}/device"
> + ;;
> + */nvme-subsystem)
> + for c in "${TEST_DEV_SYSFS}"/device/nvme*; do
> + [[ -L "$c" ]] || continue
> + [[ -f "$c/dev" ]] && readlink -f "$c"
> + done
> + ;;
> + esac
> +}
> +
I don't know if I am missing anything here but just curious to know
for which case $subsys would point to link ending in */nvme?
I think that for all cases $subsys shall point to link which ends
in */nvme-subsystem, isn't it? I assume here that $TEST_DEV_SYSFS would
always resolve to a nvme block device.
And the last point: I don't see 053.out file in your patchset. Did you forget
to add this file?
Thanks,
--Nilay
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH 3/3] nvme: add test for controller rescan under I/O load
2024-08-23 10:18 ` Nilay Shroff
@ 2024-08-23 13:39 ` Nilay Shroff
2024-08-23 14:49 ` Martin Wilck
1 sibling, 0 replies; 13+ messages in thread
From: Nilay Shroff @ 2024-08-23 13:39 UTC (permalink / raw)
To: Martin Wilck, Shin'ichiro Kawasaki
Cc: Chaitanya Kulkarni, Hannes Reinecke, Daniel Wagner, linux-block,
linux-nvme, Martin Wilck
On 8/23/24 15:48, Nilay Shroff wrote:
>
>
> On 8/23/24 01:08, Martin Wilck wrote:
>> Add a test that repeatedly rescans nvme controllers while doing IO
>> on an nvme namespace connected to these controllers. The purpose
>> of the test is to make sure that no I/O errors or data corruption
>> occurs because of the rescan operations.
>>
>> Signed-off-by: Martin Wilck <mwilck@suse.com>
>> ---
>> tests/nvme/053 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++
>> tests/nvme/rc | 18 ++++++++++++++++
>> 2 files changed, 74 insertions(+)
>> create mode 100755 tests/nvme/053
>>
>> diff --git a/tests/nvme/053 b/tests/nvme/053
>> new file mode 100755
>> index 0000000..41dc8f2
>> --- /dev/null
>> +++ b/tests/nvme/053
>> @@ -0,0 +1,56 @@
>> +#!/bin/bash
>> +# SPDX-License-Identifier: GPL-3.0+
>> +# Copyright (C) 2024 Martin Wilck, SUSE LLC
>> +
>> +. tests/nvme/rc
>> +
>> +DESCRIPTION="test controller rescan under I/O load"
>> +TIMED=1
>> +: "${TIMEOUT:=60}"
>> +
>> +rescan_controller() {
>> + local finish
>> +
>> + [[ -f "$1/rescan_controller" ]] || {
>> + echo "cannot rescan $1"
>> + return 1
>> + }
>> +
>> + finish=$(($(date +%s) + TIMEOUT))
>> + while [[ $(date +%s) -le $finish ]]; do
>> + # sleep interval between 0.1 and 5s
>> + usleep "$(((RANDOM%50 + 1)*100000))"
>> + echo 1 >"$1/rescan_controller"
>> + done
>> +}
> I think here usleep may not be available by default on all systems.
> For instance, on fedora/rhel I don't have usleep installed in the
> defualt configuration and so I have to first install it. So you may
> want to add "usleep" as per-requisite for this test. Moreover, after
> I installed usleep on fedora and ran the above test I see this warning:
>
> warning: usleep is deprecated, and will be removed in near future!
>
> Due to above warning the test fails. So is it possible to replace
> usleep with sleep?
>
>> +
>> +test_device() {
>> + local -a ctrls
>> + local c
>> +
>> + echo "Running ${TEST_NAME}"
>> + ctrls=($(_nvme_get_ctrl_list))
>> +
>> + _run_fio_verify_io --filename="$TEST_DEV" --time_based &> "$FULL" &
>> +
>> + for c in "${ctrls[@]}"; do
>> + rescan_controller "$c" &
>> + done
>> +
>> + while true; do
>> + wait -n &>/dev/null
>> + st=$?
>> + case $st in
>> + 127)
>> + break
>> + ;;
>> + 0)
>> + ;;
>> + *)
>> + echo "child process exited with $st!"
>> + ;;
>> + esac
>> + done
>> +
>> + echo "Test complete"
>> +}
>> diff --git a/tests/nvme/rc b/tests/nvme/rc
>> index e7d2ab1..93b0571 100644
>> --- a/tests/nvme/rc
>> +++ b/tests/nvme/rc
>> @@ -192,6 +192,24 @@ _test_dev_nvme_nsid() {
>> cat "${TEST_DEV_SYSFS}/nsid"
>> }
>>
>> +_nvme_get_ctrl_list() {
>> + local subsys
>> + local c
>> +
>> + subsys=$(readlink "${TEST_DEV_SYSFS}/device/subsystem")
>> + case $subsys in
>> + */nvme)
>> + readlink -f "${TEST_DEV_SYSFS}/device"
>> + ;;
>> + */nvme-subsystem)
>> + for c in "${TEST_DEV_SYSFS}"/device/nvme*; do
>> + [[ -L "$c" ]] || continue
>> + [[ -f "$c/dev" ]] && readlink -f "$c"
>> + done
>> + ;;
>> + esac
>> +}
>> +
> I don't know if I am missing anything here but just curious to know
> for which case $subsys would point to link ending in */nvme?
> I think that for all cases $subsys shall point to link which ends
> in */nvme-subsystem, isn't it? I assume here that $TEST_DEV_SYSFS would
> always resolve to a nvme block device.
>
I think I got the answer for the above query, when I disabled the nvme
multipath in the kernel config, I could see we hit the first case when
$subsys would point to the link ending in */nvme, so this is not an issue.
> And the last point: I don't see 053.out file in your patchset. Did you forget
> to add this file?
>
> Thanks,
> --Nilay
>
>
>
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH 3/3] nvme: add test for controller rescan under I/O load
2024-08-23 10:18 ` Nilay Shroff
2024-08-23 13:39 ` Nilay Shroff
@ 2024-08-23 14:49 ` Martin Wilck
1 sibling, 0 replies; 13+ messages in thread
From: Martin Wilck @ 2024-08-23 14:49 UTC (permalink / raw)
To: Nilay Shroff, Shin'ichiro Kawasaki
Cc: Chaitanya Kulkarni, Hannes Reinecke, Daniel Wagner, linux-block,
linux-nvme
On Fri, 2024-08-23 at 15:48 +0530, Nilay Shroff wrote:
>
> On 8/23/24 01:08, Martin Wilck wrote:
> >
> > + finish=$(($(date +%s) + TIMEOUT))
> > + while [[ $(date +%s) -le $finish ]]; do
> > + # sleep interval between 0.1 and 5s
> > + usleep "$(((RANDOM%50 + 1)*100000))"
> > + echo 1 >"$1/rescan_controller"
> > + done
> > +}
> I think here usleep may not be available by default on all systems.
> For instance, on fedora/rhel I don't have usleep installed in the
> defualt configuration and so I have to first install it. So you may
> want to add "usleep" as per-requisite for this test. Moreover, after
> I installed usleep on fedora and ran the above test I see this
> warning:
>
> warning: usleep is deprecated, and will be removed in near future!
>
> Due to above warning the test fails. So is it possible to replace
> usleep with sleep?
The README states that blktests requires GNU coreutils, so yes, that
would be feasible - in principle.
The problem is that bash can't do floating point math, and I want to
be able to sleep for fractions of a second. So I'd need to do something
like this:
usleep() {
sleep "$(awk "BEGIN { print $1 / 1.e6; }" </dev/null)"
}
But the fork-and-exec to "awk" is slow. millisecond sleep times can't
be realized this way. Anyway, I realize that calling "usleep" also
carries a lot of overhead, and thus "usleep 1000" doesn't do what one
would naïvely expect, either.
The only way I can see to make this work as originally intended is to
implement is as an awk script. The README says that GNU awk is
required, so sleep() with floating point argument is available.
Thanks
Martin
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] blktests: nvme: skip passthru tests on multipath devices
2024-08-22 19:38 [PATCH 1/3] blktests: nvme: skip passthru tests on multipath devices Martin Wilck
2024-08-22 19:38 ` [PATCH 2/3] blktests: nvme/032: skip on non-PCI devices Martin Wilck
2024-08-22 19:38 ` [PATCH 3/3] nvme: add test for controller rescan under I/O load Martin Wilck
@ 2024-08-23 6:35 ` Daniel Wagner
2024-08-23 6:41 ` Martin Wilck
2 siblings, 1 reply; 13+ messages in thread
From: Daniel Wagner @ 2024-08-23 6:35 UTC (permalink / raw)
To: Martin Wilck
Cc: Shin'ichiro Kawasaki, Chaitanya Kulkarni, Hannes Reinecke,
linux-block, linux-nvme, Martin Wilck
On Thu, Aug 22, 2024 at 09:38:12PM GMT, Martin Wilck wrote:
> +_require_test_dev_is_nvme_no_mpath() {
> + if [[ "$(readlink -f "$TEST_DEV_SYSFS/device")" =~ /nvme-subsystem/ ]]; then
> + SKIP_REASONS+=("$TEST_DEV is a NVMe multipath device")
> + return 1
> + fi
> + return 0
> +}
Just a nit: what about _require_test_dev_is_native_multipath?
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH 1/3] blktests: nvme: skip passthru tests on multipath devices
2024-08-23 6:35 ` [PATCH 1/3] blktests: nvme: skip passthru tests on multipath devices Daniel Wagner
@ 2024-08-23 6:41 ` Martin Wilck
2024-08-23 7:07 ` Daniel Wagner
0 siblings, 1 reply; 13+ messages in thread
From: Martin Wilck @ 2024-08-23 6:41 UTC (permalink / raw)
To: Daniel Wagner
Cc: Shin'ichiro Kawasaki, Chaitanya Kulkarni, Hannes Reinecke,
linux-block, linux-nvme
On Fri, 2024-08-23 at 08:35 +0200, Daniel Wagner wrote:
> On Thu, Aug 22, 2024 at 09:38:12PM GMT, Martin Wilck wrote:
> > +_require_test_dev_is_nvme_no_mpath() {
> > + if [[ "$(readlink -f "$TEST_DEV_SYSFS/device")" =~ /nvme-
> > subsystem/ ]]; then
> > + SKIP_REASONS+=("$TEST_DEV is a NVMe multipath
> > device")
> > + return 1
> > + fi
> > + return 0
> > +}
>
> Just a nit: what about _require_test_dev_is_native_multipath?
The intention was to require a device that is _not_ a native multipath
device. Change it to "_require_test_dev_is_not_native_multipath"?
Thanks,
Martin
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH 1/3] blktests: nvme: skip passthru tests on multipath devices
2024-08-23 6:41 ` Martin Wilck
@ 2024-08-23 7:07 ` Daniel Wagner
0 siblings, 0 replies; 13+ messages in thread
From: Daniel Wagner @ 2024-08-23 7:07 UTC (permalink / raw)
To: Martin Wilck
Cc: Shin'ichiro Kawasaki, Chaitanya Kulkarni, Hannes Reinecke,
linux-block, linux-nvme
On Fri, Aug 23, 2024 at 08:41:59AM GMT, Martin Wilck wrote:
> On Fri, 2024-08-23 at 08:35 +0200, Daniel Wagner wrote:
> > On Thu, Aug 22, 2024 at 09:38:12PM GMT, Martin Wilck wrote:
> > > +_require_test_dev_is_nvme_no_mpath() {
> > > + if [[ "$(readlink -f "$TEST_DEV_SYSFS/device")" =~ /nvme-
> > > subsystem/ ]]; then
> > > + SKIP_REASONS+=("$TEST_DEV is a NVMe multipath
> > > device")
> > > + return 1
> > > + fi
> > > + return 0
> > > +}
> >
> > Just a nit: what about _require_test_dev_is_native_multipath?
>
> The intention was to require a device that is _not_ a native multipath
> device. Change it to "_require_test_dev_is_not_native_multipath"?
I confused mpath with dm-mpath when I read the function name. Doesn't
make any sence obviously but still got me confused. I prefer the more
explicit function name you suggested. But let's here what others say.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2024-08-23 14:50 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-22 19:38 [PATCH 1/3] blktests: nvme: skip passthru tests on multipath devices Martin Wilck
2024-08-22 19:38 ` [PATCH 2/3] blktests: nvme/032: skip on non-PCI devices Martin Wilck
2024-08-23 6:46 ` Daniel Wagner
2024-08-22 19:38 ` [PATCH 3/3] nvme: add test for controller rescan under I/O load Martin Wilck
2024-08-23 6:45 ` Daniel Wagner
2024-08-23 6:50 ` Martin Wilck
2024-08-23 7:03 ` Daniel Wagner
2024-08-23 10:18 ` Nilay Shroff
2024-08-23 13:39 ` Nilay Shroff
2024-08-23 14:49 ` Martin Wilck
2024-08-23 6:35 ` [PATCH 1/3] blktests: nvme: skip passthru tests on multipath devices Daniel Wagner
2024-08-23 6:41 ` Martin Wilck
2024-08-23 7:07 ` Daniel Wagner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox