block: fix fio jobs for 027 and add cgroup support
PATCH 1/1 block: fix fio jobs for 027 and add cgroup support
Previously, the test was broken as "$fio_jobs" was considered as a string instead of additional parameters. This is fixed here.
Second, there was an issue with earlier kernels when request lists existed such that request_queues were never being cleaned up because non-root blkgs took a reference on the queue. However, blkgs were being cleaned up after the last reference to the request_queue was put back. This creates a blktest cgroup for the fio jobs to utilize and should be useful for catching this scenario in the future.
--- tests/block/027 | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
tests/block/027 +14 -3
@@ -26,6 +26,13 @@ scsi_debug_stress_remove() { return fi + _init_cgroup2 + + # setup cgroups + echo "+io" > "/sys/fs/cgroup/cgroup.subtree_control" + echo "+io" > "$CGROUP2_DIR/cgroup.subtree_control" + mkdir "$CGROUP2_DIR/fast" + # set higher aio limit echo 524288 > /proc/sys/fs/aio-max-nr
@@ -45,13 +52,13 @@ scsi_debug_stress_remove() { ((cnt++)) done - local num_jobs=4 runtime=21 + local num_jobs=4 runtime=12 fio --rw=randread --size=128G --direct=1 --ioengine=libaio \ --iodepth=2048 --numjobs=$num_jobs --bs=4k \ --group_reporting=1 --group_reporting=1 --runtime=$runtime \ - --loops=10000 "$fio_jobs" > "$FULL" 2>&1 & + --loops=10000 --cgroup=blktests/fast $fio_jobs > "$FULL" 2>&1 & - sleep 7 + sleep 6 local device_path for dev in "${SCSI_DEBUG_DEVICES[@]}"; do # shutdown devices in progress
@@ -61,6 +68,10 @@ scsi_debug_stress_remove() { wait + sleep 10 + + _exit_cgroup2 + _exit_scsi_debug }
Signature · 1 line
2.17.1
Quoted 11 lines · Dennis Zhou
Previously, the test was broken as "$fio_jobs" was considered as a string instead of additional parameters. This is fixed here.
Second, there was an issue with earlier kernels when request lists existed such that
request_queueswere never being cleaned up because non-root blkgs took a reference on the queue. However, blkgs were being cleaned up after the last reference to therequest_queuewas put back. This creates a blktest cgroup for the fio jobs to utilize and should be useful for catching this scenario in the future.Signed-off-by Dennis Zhou <[email protected]>
Would it be valuable to test this both in a cgroup and not in a cgroup?
Quoted 8 lines
tests/block/027 | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)tests/block/027 +0
-0
tests/block/027 scsi_debug_stress_remove() { · line 35
Quoted 10 lines
tests/block/027 +7
-0@@ -26,6 +26,13 @@ scsi_debug_stress_remove() { return fi + _init_cgroup2 + + # setup cgroups + echo "+io" > "/sys/fs/cgroup/cgroup.subtree_control" + echo "+io" > "$CGROUP2_DIR/cgroup.subtree_control" + mkdir "$CGROUP2_DIR/fast" +
Why is this called "fast"?
Quoted 7 lines
tests/block/027 +0
-0# set higher aio limit echo 524288 > /proc/sys/fs/aio-max-nr@@ -45,13 +52,13 @@ scsi_debug_stress_remove() { ((cnt++)) done
tests/block/027 scsi_debug_stress_remove() { · line 61
Quoted 10 lines
tests/block/027 +3
-3- local num_jobs=4 runtime=21 + local num_jobs=4 runtime=12 fio --rw=randread --size=128G --direct=1 --ioengine=libaio \ --iodepth=2048 --numjobs=$num_jobs --bs=4k \ --group_reporting=1 --group_reporting=1 --runtime=$runtime \ - --loops=10000 "$fio_jobs" > "$FULL" 2>&1 & + --loops=10000 --cgroup=blktests/fast $fio_jobs > "$FULL" 2>&1 & - sleep 7 + sleep 6
Is there any particular reason you changed the run time and sleep time and added the sleep at the end?
Quoted 17 lines
tests/block/027 +4
-0local device_path for dev in "${SCSI_DEBUG_DEVICES[@]}"; do # shutdown devices in progress@@ -61,6 +68,10 @@ scsi_debug_stress_remove() { wait + sleep 10 + + _exit_cgroup2 + _exit_scsi_debug }Signature · 1 line
2.17.1
Quoted 11 lines · Omar Sandoval
Quoted 10 lines · Dennis Zhou
Previously, the test was broken as "$fio_jobs" was considered as a string instead of additional parameters. This is fixed here.
Second, there was an issue with earlier kernels when request lists existed such that
request_queueswere never being cleaned up because non-root blkgs took a reference on the queue. However, blkgs were being cleaned up after the last reference to therequest_queuewas put back. This creates a blktest cgroup for the fio jobs to utilize and should be useful for catching this scenario in the future.
Quoted 4 lines
Quoted 1 line
Signed-off-by Dennis Zhou <[email protected]>Would it be valuable to test this both in a cgroup and not in a cgroup?
I lean towards no because testing in a cgroup should subsume testing not in a cgroup.
Quoted 11 lines
Quoted 11 lines
tests/block/027 | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)tests/block/027 +0
-0@@ -26,6 +26,13 @@ scsi_debug_stress_remove() { return fi
Quoted 10 lines
tests/block/027 scsi_debug_stress_remove() { · line 35
Quoted 7 lines
tests/block/027 +7
-0+ _init_cgroup2 + + # setup cgroups + echo "+io" > "/sys/fs/cgroup/cgroup.subtree_control" + echo "+io" > "$CGROUP2_DIR/cgroup.subtree_control" + mkdir "$CGROUP2_DIR/fast" +Why is this called "fast"?
I just picked a name from Josef's test. I was hesitant to use ${TEST_NAME} because of the /, but there's no reason that's not okay.
Quoted 15 lines
Quoted 15 lines
tests/block/027 +2
-2# set higher aio limit echo 524288 > /proc/sys/fs/aio-max-nr@@ -45,13 +52,13 @@ scsi_debug_stress_remove() { ((cnt++)) done - local num_jobs=4 runtime=21 + local num_jobs=4 runtime=12 fio --rw=randread --size=128G --direct=1 --ioengine=libaio \ --iodepth=2048 --numjobs=$num_jobs --bs=4k \ --group_reporting=1 --group_reporting=1 --runtime=$runtime \ - --loops=10000 "$fio_jobs" > "$FULL" 2>&1 & + --loops=10000 --cgroup=blktests/fast $fio_jobs > "$FULL" 2>&1 &
Quoted 6 lines
tests/block/027 scsi_debug_stress_remove() { · line 61
Quoted 2 lines
tests/block/027 +1
-1- sleep 7 + sleep 6Is there any particular reason you changed the run time and sleep time and added the sleep at the end?
Validating this is a little tricky because we don't export statistics around blkgs. The change in runtime and sleep here is just to shorten the test. Enough time has passed that everything is setup and enough IOs go through and fail to be sure that this all works.
The sleep below should probably be a little shorter, but it's to more easily validate that the blkg cleanup is due to request_queue cleanup vs cgroup cleanup. Prior, I made a bad assumption that everything was okay due to always cleaning up the cgroup when in reality request_queue cleanup was failing first.
Quoted 14 lines
Quoted 14 lines
tests/block/027 +4
-0local device_path for dev in "${SCSI_DEBUG_DEVICES[@]}"; do # shutdown devices in progress@@ -61,6 +68,10 @@ scsi_debug_stress_remove() { wait + sleep 10 + + _exit_cgroup2 + _exit_scsi_debug }
Quoted 3 lines
Quoted 3 lines
Signature · 1 line
2.17.1
I'll send a v2 switching the naming to ${TEST_NAME} + shortening the last sleep.
Thanks,
Dennis