allow to run most tests with built-in null_blk
Hi Shin'ichiro,
this series updates most tests that use null_blk so that they can work with a built-in null_blk driver. The onces that require shared_tags or failure injection, which currently can only be controlled through module parameters still require a module until the kernel is updated (which I plan to look into).
PATCH 1/13 common/null_blk: remove explicit queue_mode=2 parameters
queue_mode 2 (aka blk-mq) is the default in null_blk, so remove the extra explicitly parameter.
--- tests/block/006 | 2 +- tests/block/010 | 4 ++-- tests/block/014 | 2 +- tests/block/015 | 2 +- tests/block/016 | 2 +- tests/block/017 | 3 +-- tests/block/018 | 3 +-- tests/block/020 | 2 +- tests/block/022 | 2 +- tests/block/024 | 3 +-- tests/block/029 | 2 +- tests/block/030 | 2 +- tests/block/031 | 2 +- 13 files changed, 14 insertions(+), 17 deletions(-)
tests/block/006 +1 -1
@@ -24,7 +24,7 @@ test() { _divide_timeout 2 FIO_PERF_FIELDS=("read iops") - if ! _init_null_blk queue_mode=2 submit_queues=2 blocking=1; then + if ! _init_null_blk submit_queues=2 blocking=1; then return 1 fi
tests/block/010 +2 -2
@@ -49,7 +49,7 @@ test() { _divide_timeout 2 - if ! _init_null_blk queue_mode=2 submit_queues=16 nr_devices=32; then + if ! _init_null_blk submit_queues=16 nr_devices=32; then return 1 fi
@@ -58,7 +58,7 @@ test() { run_fio_job _exit_null_blk - if ! _init_null_blk queue_mode=2 submit_queues=16 nr_devices=32 shared_tags=1; then + if ! _init_null_blk submit_queues=16 nr_devices=32 shared_tags=1; then return 1 fi
tests/block/014 +1 -1
@@ -18,7 +18,7 @@ test() { # The format is "<interval>,<probability>,<space>,<times>". Here, we # fail 50% of I/Os. - if ! _init_null_blk queue_mode=2 timeout='1,50,0,-1'; then + if ! _init_null_blk timeout='1,50,0,-1'; then return 1 fi
tests/block/015 +1 -1
@@ -20,7 +20,7 @@ test() { # The format is "<interval>,<probability>,<space>,<times>". Here, we # requeue 10% of the time. - if ! _init_null_blk queue_mode=2 requeue='1,10,0,-1'; then + if ! _init_null_blk requeue='1,10,0,-1'; then return 1 fi
tests/block/016 +1 -1
@@ -20,7 +20,7 @@ requires() { test() { echo "Running ${TEST_NAME}" - if ! _init_null_blk queue_mode=2 irqmode=2 completion_nsec=2000000000; then + if ! _init_null_blk irqmode=2 completion_nsec=2000000000; then return 1 fi
tests/block/017 +1 -2
@@ -27,8 +27,7 @@ show_inflight() { test() { echo "Running ${TEST_NAME}" - if ! _init_null_blk queue_mode=2 irqmode=2 \ - completion_nsec=500000000; then + if ! _init_null_blk irqmode=2 completion_nsec=500000000; then return 1 fi
tests/block/018 +1 -2
@@ -33,8 +33,7 @@ test() { echo "Running ${TEST_NAME}" - if ! _init_null_blk queue_mode=2 irqmode=2 \ - completion_nsec=1000000000; then + if ! _init_null_blk irqmode=2 completion_nsec=1000000000; then return 1 fi
tests/block/020 +1 -1
@@ -20,7 +20,7 @@ requires() { test() { echo "Running ${TEST_NAME}" - if ! _init_null_blk queue_mode=2 irqmode=2 completion_nsec=2000000 \ + if ! _init_null_blk irqmode=2 completion_nsec=2000000 \ submit_queues=4 hw_queue_depth=1; then return 1 fi
tests/block/022 +1 -1
@@ -28,7 +28,7 @@ test() { echo "Running ${TEST_NAME}" : "${TIMEOUT:=30}" - if ! _init_null_blk shared_tags=1 nr_devices=0 queue_mode=2; then + if ! _init_null_blk shared_tags=1 nr_devices=0; then return 1 fi
tests/block/024 +1 -2
@@ -37,8 +37,7 @@ test() { # The maximum value for CONFIG_HZ is 1000. I.e., a tick is one # millisecond. So, make each I/O take half a millisecond. - if ! _init_null_blk queue_mode=2 irqmode=2 \ - completion_nsec=500000; then + if ! _init_null_blk irqmode=2 completion_nsec=500000; then return 1 fi
tests/block/029 +1 -1
@@ -31,7 +31,7 @@ test() { local sq=/sys/kernel/config/nullb/nullb0/submit_queues : "${TIMEOUT:=30}" - _init_null_blk nr_devices=0 queue_mode=2 && + _init_null_blk nr_devices=0 && _configure_null_blk nullb0 completion_nsec=0 blocksize=512 \ size=16 memory_backed=1 power=1 && if { echo 1 >$sq; } 2>/dev/null; then
tests/block/030 +1 -1
@@ -22,7 +22,7 @@ test() { : "${TIMEOUT:=30}" # Legend: init_hctx=<interval>,<probability>,<space>,<times> # Set <space> to $(nproc) + 1 to make loading of null_blk succeed. - if ! _init_null_blk nr_devices=0 queue_mode=2 \ + if ! _init_null_blk nr_devices=0 \ "init_hctx=$(nproc),100,$(($(nproc) + 1)),-1"; then echo "Loading null_blk failed" return 1
tests/block/031 +1 -1
@@ -18,7 +18,7 @@ test() { local fio_status bs=512 : "${TIMEOUT:=30}" - if ! _init_null_blk nr_devices=0 queue_mode=2 shared_tag_bitmap=1; then + if ! _init_null_blk nr_devices=0 shared_tag_bitmap=1; then echo "Loading null_blk failed" return 1 fi
Signature · 1 line
2.30.2
Re: [PATCH blktests 01/13] common/null_blk: remove explicit queue_mode=2 parameters
Quoted 5 lines · Christoph Hellwig
queue_mode2 (aka blk-mq) is the default innull_blk, so remove the extra explicitly parameter.Signed-off-by Christoph Hellwig <[email protected]>---
Looks good.
-ck
PATCH 2/13 common/null_blk: allow _configure_null_blk with built-in null_blk
In reply to Christoph HellwigTest that do use _configure_null_blk already configure do not actually require a built-in null_blk driver. Relax the check in _have_null_blk to just require a driver instead of a module, and instead set a skip reason instead of failing in _init_null_blk when null_blk is built-in or otherwise not available.
--- common/null_blk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
common/null_blk +4 -1
@@ -4,8 +4,10 @@ # # null_blk helper functions. +. common/shellcheck + _have_null_blk() { - _have_modules null_blk + _have_driver null_blk } _remove_null_blk_devices() {
@@ -22,6 +24,7 @@ _init_null_blk() { if (( RUN_FOR_ZONED )); then zoned="zoned=1"; fi if ! modprobe -r null_blk || ! modprobe null_blk "$@" "${zoned}" ; then + SKIP_REASON="requires modular null_blk" return 1 fi
Signature · 1 line
2.30.2
PATCH 3/13 common/null_blk: respect RUN_FOR_ZONED in _configure_null_blk
In reply to Christoph HellwigCreate zoned devices in _configure_null_blk when RUN_FOR_ZONED is set, just like it is done in _init_null_blk
--- common/null_blk | 5 +++++ 1 file changed, 5 insertions(+)
common/null_blk +5 -0
@@ -38,6 +38,11 @@ _configure_null_blk() { shift mkdir "$nullb" || return $? + + if (( RUN_FOR_ZONED )); then + echo "1" > "$nullb/zoned" || return $? + fi + while [[ $# -gt 0 ]]; do param="${1%%=*}" val="${1#*=}"
Signature · 1 line
2.30.2
PATCH 4/13 block/029: don't require modular null_blk
In reply to Christoph HellwigDrop the call to _init_null_blk and just operate on nullb1 instead, leaving the default device alone.
--- tests/block/029 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
tests/block/029 +6 -7
@@ -21,25 +21,24 @@ modify_nr_hw_queues() { num_cpus=$(nproc) while [ "$(_uptime_s)" -lt "$deadline" ]; do sleep .1 - echo 1 > /sys/kernel/config/nullb/nullb0/submit_queues + echo 1 > /sys/kernel/config/nullb/nullb1/submit_queues sleep .1 - echo "$num_cpus" > /sys/kernel/config/nullb/nullb0/submit_queues + echo "$num_cpus" > /sys/kernel/config/nullb/nullb1/submit_queues done } test() { - local sq=/sys/kernel/config/nullb/nullb0/submit_queues + local sq=/sys/kernel/config/nullb/nullb1/submit_queues : "${TIMEOUT:=30}" - _init_null_blk nr_devices=0 && - _configure_null_blk nullb0 completion_nsec=0 blocksize=512 \ + _configure_null_blk nullb1 completion_nsec=0 blocksize=512 \ size=16 memory_backed=1 power=1 && if { echo 1 >$sq; } 2>/dev/null; then modify_nr_hw_queues & fio --rw=randwrite --bs=4K --loops=$((10**6)) \ --iodepth=64 --group_reporting --sync=1 --direct=1 \ - --ioengine=libaio --filename="/dev/nullb0" \ - --runtime="${TIMEOUT}" --name=nullb0 \ + --ioengine=libaio --filename="/dev/nullb1" \ + --runtime="${TIMEOUT}" --name=nullb1 \ --output="${RESULTS_DIR}/block/fio-output-029.txt" \ >>"$FULL" wait
Signature · 1 line
2.30.2
PATCH 5/13 block/006: convert to use _configure_null_blk
In reply to Christoph HellwigSwitch to use _configure_null_blk so that built-in null_blk can be supported, which implies not using the default nullb0 device.
--- tests/block/006 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tests/block/006 +3 -3
@@ -24,18 +24,18 @@ test() { _divide_timeout 2 FIO_PERF_FIELDS=("read iops") - if ! _init_null_blk submit_queues=2 blocking=1; then + if ! _configure_null_blk nullb1 submit_queues=2 blocking=1 power=1; then return 1 fi # run sync test _fio_perf --bs=4k --ioengine=sync --rw=randread --norandommap --name=sync \ - --filename=/dev/nullb0 --size=5g --direct=1 + --filename=/dev/nullb1 --size=5g --direct=1 # run async test _fio_perf --bs=4k --ioengine=libaio --iodepth=8 --numjobs="$(nproc)" \ --rw=randread --norandommap --name=async \ - --filename=/dev/nullb0 --size=5g --direct=1 + --filename=/dev/nullb1 --size=5g --direct=1 _exit_null_blk
Signature · 1 line
2.30.2
PATCH 6/13 block/016: convert to use _configure_null_blk
In reply to Christoph HellwigSwitch to use _configure_null_blk so that built-in null_blk can be supported, which implies not using the default nullb0 device.
--- tests/block/016 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
tests/block/016 +5 -4
@@ -20,21 +20,22 @@ requires() { test() { echo "Running ${TEST_NAME}" - if ! _init_null_blk irqmode=2 completion_nsec=2000000000; then + if ! _configure_null_blk nullb1 irqmode=2 completion_nsec=2000000000 \ + power=1; then return 1 fi # Start an I/O, which will take two seconds. - dd if=/dev/nullb0 of=/dev/null bs=512 iflag=direct count=1 status=none & + dd if=/dev/nullb1 of=/dev/null bs=512 iflag=direct count=1 status=none & sleep 0.5 # This will freeze the queue, and since we have an I/O in flight, it # will stay frozen until the I/O completes. - echo 64 > /sys/block/nullb0/queue/nr_requests & + echo 64 > /sys/block/nullb1/queue/nr_requests & sleep 0.5 # Do an I/O, which will wait for the queue to unfreeze. - dd if=/dev/nullb0 of=/dev/null bs=512 iflag=direct count=1 status=none & + dd if=/dev/nullb1 of=/dev/null bs=512 iflag=direct count=1 status=none & sleep 0.5 # While dd is blocked, send a signal which we know dd has a handler
Signature · 1 line
2.30.2
PATCH 7/13 block/017: convert to use _configure_null_blk
In reply to Christoph HellwigSwitch to use _configure_null_blk so that built-in null_blk can be supported, which implies not using the default nullb0 device.
--- tests/block/017 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
tests/block/017 +7 -6
@@ -19,23 +19,24 @@ requires() { show_inflight() { awk '{ printf "sysfs inflight reads %d\nsysfs inflight writes %d\n", $1, $2 }' \ - /sys/block/nullb0/inflight - awk '{ print "sysfs stat " $9 }' /sys/block/nullb0/stat - awk '$3 == "nullb0" { print "diskstats " $12 }' /proc/diskstats + /sys/block/nullb1/inflight + awk '{ print "sysfs stat " $9 }' /sys/block/nullb1/stat + awk '$3 == "nullb1" { print "diskstats " $12 }' /proc/diskstats } test() { echo "Running ${TEST_NAME}" - if ! _init_null_blk irqmode=2 completion_nsec=500000000; then + if ! _configure_null_blk nullb1 irqmode=2 completion_nsec=500000000 \ + power=1; then return 1 fi - dd if=/dev/nullb0 of=/dev/null bs=4096 iflag=direct count=1 status=none & + dd if=/dev/nullb1 of=/dev/null bs=4096 iflag=direct count=1 status=none & sleep 0.1 show_inflight - dd if=/dev/zero of=/dev/nullb0 bs=4096 oflag=direct count=1 status=none & + dd if=/dev/zero of=/dev/nullb1 bs=4096 oflag=direct count=1 status=none & sleep 0.1 show_inflight
Signature · 1 line
2.30.2
PATCH 8/13 block/018: convert to use _configure_null_blk
In reply to Christoph HellwigSwitch to use _configure_null_blk so that built-in null_blk can be supported, which implies not using the default nullb0 device.
--- tests/block/018 | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
tests/block/018 +11 -10
@@ -15,13 +15,13 @@ requires() { } init_times() { - init_read_ms="$(awk '{ print $4 }' /sys/block/nullb0/stat)" - init_write_ms="$(awk '{ print $8 }' /sys/block/nullb0/stat)" + init_read_ms="$(awk '{ print $4 }' /sys/block/nullb1/stat)" + init_write_ms="$(awk '{ print $8 }' /sys/block/nullb1/stat)" } show_times() { - read_ms="$(awk '{ print $4 }' /sys/block/nullb0/stat)" - write_ms="$(awk '{ print $8 }' /sys/block/nullb0/stat)" + read_ms="$(awk '{ print $4 }' /sys/block/nullb1/stat)" + write_ms="$(awk '{ print $8 }' /sys/block/nullb1/stat)" # Print rounded to the nearest second printf 'read %d s\n' $(((read_ms - init_read_ms + 500) / 1000))
@@ -33,22 +33,23 @@ test() { echo "Running ${TEST_NAME}" - if ! _init_null_blk irqmode=2 completion_nsec=1000000000; then + if ! _configure_null_blk nullb1 irqmode=2 completion_nsec=1000000000 \ + power=1; then return 1 fi init_times show_times - dd if=/dev/nullb0 of=/dev/null bs=4096 iflag=direct count=1 status=none + dd if=/dev/nullb1 of=/dev/null bs=4096 iflag=direct count=1 status=none show_times - dd if=/dev/zero of=/dev/nullb0 bs=4096 oflag=direct count=1 status=none + dd if=/dev/zero of=/dev/nullb1 bs=4096 oflag=direct count=1 status=none show_times - dd if=/dev/nullb0 of=/dev/null bs=4096 iflag=direct count=1 status=none & - dd if=/dev/zero of=/dev/nullb0 bs=4096 oflag=direct count=1 status=none & - dd if=/dev/zero of=/dev/nullb0 bs=4096 oflag=direct count=1 status=none & + dd if=/dev/nullb1 of=/dev/null bs=4096 iflag=direct count=1 status=none & + dd if=/dev/zero of=/dev/nullb1 bs=4096 oflag=direct count=1 status=none & + dd if=/dev/zero of=/dev/nullb1 bs=4096 oflag=direct count=1 status=none & wait show_times
Signature · 1 line
2.30.2
PATCH 9/13 block/020: convert to use _configure_null_blk
In reply to Christoph HellwigSwitch to use _configure_null_blk so that built-in null_blk can be supported, which implies not using the default nullb0 device.
--- tests/block/020 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
tests/block/020 +5 -5
@@ -20,14 +20,14 @@ requires() { test() { echo "Running ${TEST_NAME}" - if ! _init_null_blk irqmode=2 completion_nsec=2000000 \ - submit_queues=4 hw_queue_depth=1; then + if ! _configure_null_blk nullb1 irqmode=2 completion_nsec=2000000 \ + submit_queues=4 hw_queue_depth=1 power=1; then return 1 fi local scheds # shellcheck disable=SC2207 - scheds=($(sed 's/[][]//g' /sys/block/nullb0/queue/scheduler)) + scheds=($(sed 's/[][]//g' /sys/block/nullb1/queue/scheduler)) local max_iodepth=$(($(cat /proc/sys/fs/aio-max-nr) / $(nproc))) local iodepth=1024
@@ -36,10 +36,10 @@ test() { fi for sched in "${scheds[@]}"; do echo "Testing $sched" >> "$FULL" - echo "$sched" > /sys/block/nullb0/queue/scheduler + echo "$sched" > /sys/block/nullb1/queue/scheduler _fio_perf --bs=4k --ioengine=libaio --iodepth=$iodepth \ --numjobs="$(nproc)" --rw=randread --name=async \ - --filename=/dev/nullb0 --size=1g --direct=1 \ + --filename=/dev/nullb1 --size=1g --direct=1 \ --runtime=10 done
Signature · 1 line
2.30.2
PATCH 10/13 block/021: convert to use _configure_null_blk
In reply to Christoph HellwigSwitch to use _configure_null_blk so that built-in null_blk can be supported, which implies not using the default nullb0 device.
--- tests/block/021 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
tests/block/021 +5 -5
@@ -20,7 +20,7 @@ requires() { test() { echo "Running ${TEST_NAME}" - if ! _init_null_blk; then + if ! _configure_null_blk nullb1 power=1; then return 1 fi
@@ -28,14 +28,14 @@ test() { local nr local scheds # shellcheck disable=SC2207 - scheds=($(sed 's/[][]//g' /sys/block/nullb0/queue/scheduler)) + scheds=($(sed 's/[][]//g' /sys/block/nullb1/queue/scheduler)) for sched in "${scheds[@]}"; do echo "Testing $sched" >> "$FULL" - echo "$sched" > /sys/block/nullb0/queue/scheduler - max_nr="$(cat /sys/block/nullb0/queue/nr_requests)" + echo "$sched" > /sys/block/nullb1/queue/scheduler + max_nr="$(cat /sys/block/nullb1/queue/nr_requests)" for ((nr = 4; nr <= max_nr; nr++)); do - echo "$nr" > /sys/block/nullb0/queue/nr_requests + echo "$nr" > /sys/block/nullb1/queue/nr_requests done done
Signature · 1 line
2.30.2
PATCH 11/13 block/023: convert to use _configure_null_blk
In reply to Christoph HellwigSwitch to use _configure_null_blk so that built-in null_blk can be supported, which implies not using the default nullb0 device.
--- tests/block/023 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
tests/block/023 +4 -3
@@ -21,10 +21,11 @@ test() { local queue_mode for queue_mode in 0 2; do - if _init_null_blk gb=1 queue_mode="$queue_mode"; then + if _configure_null_blk nullb1 size=1048576 \ + queue_mode="$queue_mode" power=1; then echo "Queue mode $queue_mode" - dd if=/dev/nullb0 of=/dev/null iflag=direct bs=64k status=none - dd if=/dev/null of=/dev/nullb0 oflag=direct bs=64k status=none + dd if=/dev/nullb1 of=/dev/null iflag=direct bs=64k status=none + dd if=/dev/null of=/dev/nullb1 oflag=direct bs=64k status=none _exit_null_blk fi done
Signature · 1 line
2.30.2
PATCH 12/13 block/024: convert to use _configure_null_blk
In reply to Christoph HellwigSwitch to use _configure_null_blk so that built-in null_blk can be supported, which implies not using the default nullb0 device.
--- tests/block/024 | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
tests/block/024 +11 -10
@@ -17,13 +17,13 @@ requires() { } init_times() { - init_read_ms="$(awk '{ print $4 }' /sys/block/nullb0/stat)" - init_write_ms="$(awk '{ print $8 }' /sys/block/nullb0/stat)" + init_read_ms="$(awk '{ print $4 }' /sys/block/nullb1/stat)" + init_write_ms="$(awk '{ print $8 }' /sys/block/nullb1/stat)" } show_times() { - read_ms="$(awk '{ print $4 }' /sys/block/nullb0/stat)" - write_ms="$(awk '{ print $8 }' /sys/block/nullb0/stat)" + read_ms="$(awk '{ print $4 }' /sys/block/nullb1/stat)" + write_ms="$(awk '{ print $8 }' /sys/block/nullb1/stat)" # Print rounded to the nearest second printf 'read %d s\n' $(((read_ms - init_read_ms + 500) / 1000))
@@ -37,7 +37,8 @@ test() { # The maximum value for CONFIG_HZ is 1000. I.e., a tick is one # millisecond. So, make each I/O take half a millisecond. - if ! _init_null_blk irqmode=2 completion_nsec=500000; then + if ! _configure_null_blk nullb1 irqmode=2 completion_nsec=500000 \ + power=1; then return 1 fi
@@ -46,16 +47,16 @@ test() { # 1500 * 0.5 ms is 0.75 seconds, allowing for some overhead so # that it rounds to one second. - dd if=/dev/nullb0 of=/dev/null bs=4096 iflag=direct count=1500 status=none + dd if=/dev/nullb1 of=/dev/null bs=4096 iflag=direct count=1500 status=none show_times - dd if=/dev/zero of=/dev/nullb0 bs=4096 oflag=direct count=1500 status=none + dd if=/dev/zero of=/dev/nullb1 bs=4096 oflag=direct count=1500 status=none show_times # 1800 * 0.5 ms is 0.9 seconds. - dd if=/dev/nullb0 of=/dev/null bs=4096 iflag=direct count=1500 status=none & - dd if=/dev/zero of=/dev/nullb0 bs=4096 oflag=direct count=1800 status=none & - dd if=/dev/zero of=/dev/nullb0 bs=4096 oflag=direct count=1800 status=none & + dd if=/dev/nullb1 of=/dev/null bs=4096 iflag=direct count=1500 status=none & + dd if=/dev/zero of=/dev/nullb1 bs=4096 oflag=direct count=1800 status=none & + dd if=/dev/zero of=/dev/nullb1 bs=4096 oflag=direct count=1800 status=none & wait show_times
Signature · 1 line
2.30.2
PATCH 13/13 zbd: allow falling back to builtin null_blk
In reply to Christoph HellwigUse _configure_null_blk to configure the fallback device and thus allow for a built-in null_blk driver.
--- tests/zbd/rc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
tests/zbd/rc +4 -3
@@ -13,7 +13,7 @@ group_requires() { _have_root && _have_program blkzone && _have_program dd && - _have_kernel_option BLK_DEV_ZONED && _have_modules null_blk && + _have_kernel_option BLK_DEV_ZONED && _have_null_blk && _have_module_param null_blk zoned }
@@ -25,10 +25,11 @@ group_device_requires() { } _fallback_null_blk_zoned() { - if ! _init_null_blk zone_size=4 gb=1 zoned=1 ; then + if ! _configure_null_blk nullb1 zone_size=4 size=1048576 zoned=1 \ + power=1; then return 1 fi - echo /dev/nullb0 + echo /dev/nullb1 } #
Signature · 1 line
2.30.2
Re: [PATCH blktests 13/13] zbd: allow falling back to builtin null_blk
The word "builtin" in the commit title would be "built-in".
Quoted 22 lines · Christoph Hellwig
Use
_configure_null_blkto configure the fallback device and thus allow for a built-innull_blkdriver.Signed-off-by Christoph Hellwig <[email protected]>--- tests/zbd/rc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)tests/zbd/rc +1
-1@@ -13,7 +13,7 @@ group_requires() { _have_root && _have_program blkzone && _have_program dd && - _have_kernel_option BLK_DEV_ZONED && _have_modules null_blk && + _have_kernel_option BLK_DEV_ZONED && _have_null_blk && _have_module_param null_blk zoned }
tests/zbd/rc group_device_requires() { · line 28
Quoted 5 lines
tests/zbd/rc +1
-1@@ -25,10 +25,11 @@ group_device_requires() { } _fallback_null_blk_zoned() { - if ! _init_null_blk zone_size=4 gb=1 zoned=1 ; then + if ! _configure_null_blk nullb1 zone_size=4 size=1048576 zoned=1 \
The unit of null_blk sysfs size attribute is MB. 1048576 MB = 1 TB null_blk is too big and triggers failure of zbd/006. The value should be size=1024 to keep the same size 1 GB as before.
Quoted 11 lines
tests/zbd/rc +2
-1+ power=1; then return 1 fi - echo /dev/nullb0 + echo /dev/nullb1 } #Signature · 1 line
2.30.2
Signature · 1 line
Shin'ichiro Kawasaki
Quoted 7 lines · Christoph Hellwig
Hi Shin'ichiro,
this series updates most tests that use
null_blkso that they can work with a built-innull_blkdriver. The onces that requireshared_tagsor failure injection, which currently can only be controlled through module parameters still require a module until the kernel is updated (which I plan to look into).
Hi Christoph,
Thanks for the series. I ran tests with this series in my test system and found two problems. Could you revise the series to address them?
1) null_blk built-in: some test cases fail with modprobe message
With the series and null_blk driver built-in, I still observe a number of test cases with null_blk fail. The error message was follows:
+modprobe: FATAL: Module null_blk is builtin.
I found the modprobe -r command in _exit_null_blk() reports the message. With the additional hank below, the message goes away and I observe many passes.
common/null_blk +1 -1
@@ -54,5 +54,5 @@ _configure_null_blk() { _exit_null_blk() { _remove_null_blk_devices udevadm settle - modprobe -r null_blk + modprobe -qr null_blk }
I guess the hank was just slipped out from one of your patches. 2nd patch, probably.
2) null_blk module: block/023 and other test cases with CAN_BE_ZONED=1 fail
The test cases fail with this message:
mkdir: cannot create directory ‘/sys/kernel/config/nullb/nullb1’: No such file or directory
If null_blk is a module, _configure_null_blk assumes that the module is already loaded. This is true for most of the test cases since _have_null_blk called in requires() loads the module. But it is not true for block/023 since this test case repeats _configure_null_blk and _exit_null_blk in a loop. At the 2nd and later repetition of the loop, _exit_null_blk unloaded null_blk module and the assumption is broken. Hence the error.
Also, when RUN_ZONED_TESTS=1 is set in config, test cases with CAN_BE_ZONED=1, (block/{006,016,017,020,021,023}), repeats the test case twice, once for regular null_blk and 2nd for zoned null_blk. The 2nd run with zoned_null_blk fails with the symptom above.
I suggest to add one more commit as follows. It makes _configure_null_blk check that null_blk module is loaded. If not, loades the module.
common/null_blk +2 -0
@@ -36,6 +36,8 @@ _init_null_blk() { _configure_null_blk() { local nullb=/sys/kernel/config/nullb/$1 param val + [[ ! -d /sys/module/null_blk ]] && modprobe -q null_blk + shift mkdir "$nullb" || return $?
On top of the two problems above, I made comments on the last patch. Other than that, the series looks good to me. Thanks!
Signature · 1 line
Shin'ichiro Kawasaki