summaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorMing Lei <tom.leiming@gmail.com>2026-05-13 18:19:40 +0800
committerJens Axboe <axboe@kernel.dk>2026-05-13 07:55:39 -0600
commit87d0740b7c4cc847be1b6f307ab6d8547cb1a726 (patch)
tree373d52f4a7af345139e85ca14d669b4861417c29 /tools/perf/scripts/python
parent836efd35c472d89c838d7b17ef339ddb3286ffc5 (diff)
downloadlinux-87d0740b7c4cc847be1b6f307ab6d8547cb1a726.tar.gz
linux-87d0740b7c4cc847be1b6f307ab6d8547cb1a726.zip
selftests: ublk: cap nthreads to kernel's actual nr_hw_queues
dev->nthreads is derived from the user-requested queue count before the ADD command, but the kernel may reduce nr_hw_queues (capped to nr_cpu_ids). When the VM has fewer CPUs than requested queues, the daemon creates more handler threads than there are kernel queues. In non-batch mode, the extra threads access uninitialized queues (q_depth=0), submit zero io_uring SQEs, and block forever in io_cqring_wait. In batch mode, the extra threads cause similar hangs during device removal. In both cases, the stuck threads prevent the daemon from closing the char device, holding the last ublk_device reference and causing ublk_ctrl_del_dev() to hang in wait_event_interruptible(). Fix by capping dev->nthreads to the kernel-returned nr_hw_queues after the ADD command completes. per_io_tasks mode is excluded because threads interleave across all queues, so nthreads > nr_hw_queues is valid. Fixes: abe54c160346 ("selftests: ublk: kublk: decouple ublk_queues from ublk server threads") Signed-off-by: Ming Lei <tom.leiming@gmail.com> Link: https://patch.msgid.link/20260513101941.1373998-1-tom.leiming@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions