Re: [PATCH V2 2/2] ublk: fix race between io_uring_cmd_complete_in_task and ublk_cancel_cmd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 18, 2025 at 10:12:29PM +0300, Jared Holzman wrote:
> On 14/05/2025 4:50, Shinichiro Kawasaki wrote:

...

> 
> Hi Shinichiro,
> 
> Are you referring to test_generic_02.sh in tools/testing/selftests/ublk?
> 
> I tried running it 20 times and it didn't get stuck

It is supposed to be triggered in stress_02.sh, but turns out it isn't
stressful enough, and the hang can be duplicated with the following change:

- single queue

- random IO

- --numjobs="$(nproc)"

diff --git a/tools/testing/selftests/ublk/test_common.sh b/tools/testing/selftests/ublk/test_common.sh
index a81210ca3e99..c17fd66b73ac 100755
--- a/tools/testing/selftests/ublk/test_common.sh
+++ b/tools/testing/selftests/ublk/test_common.sh
@@ -251,7 +251,7 @@ __run_io_and_remove()
        local kill_server=$3

        fio --name=job1 --filename=/dev/ublkb"${dev_id}" --ioengine=libaio \
-               --rw=readwrite --iodepth=256 --size="${size}" --numjobs=4 \
+               --rw=randrw --norandommap --iodepth=256 --size="${size}" --numjobs="$(nproc)" \
                --runtime=20 --time_based > /dev/null 2>&1 &
        sleep 2
        if [ "${kill_server}" = "yes" ]; then
diff --git a/tools/testing/selftests/ublk/test_stress_02.sh b/tools/testing/selftests/ublk/test_stress_02.sh
index 1a9065125ae1..e532ca6bd569 100755
--- a/tools/testing/selftests/ublk/test_stress_02.sh
+++ b/tools/testing/selftests/ublk/test_stress_02.sh
@@ -30,5 +30,7 @@ ublk_io_and_kill_daemon 256M -t loop -q 4 "${UBLK_BACKFILES[0]}" &
 ublk_io_and_kill_daemon 256M -t stripe -q 4 "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" &
 wait

+ublk_io_and_kill_daemon 8G -t null -q 1
+
 _cleanup_test "stress"
 _show_result $TID $ERR_CODE



Thanks,
Ming




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux