Hi Damien,
If I run the following shell commands:
modprobe -r scsi_debug
modprobe scsi_debug delay=0 dev_size_mb=256 every_nth=2 max_queue=1 \
opts=0x8000 sector_size=4096 zbc=host-managed zone_nr_conv=0
zone_size_mb=4
while true; do
bdev=$(cd
/sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/*/block &&
echo *) 2>/dev/null
if [ -e /dev/"${bdev}" ]; then break; fi
sleep .1
done
dev=/dev/"${bdev}"
[ -b "${dev}" ]
fio --direct=1 --filename=$dev --iodepth=1 --ioengine=io_uring \
--ioscheduler=none --gtod_reduce=1 --hipri=0 --name="$(basename
"${dev}")" \
--runtime=30 --rw=rw --time_based=1 --zonemode=zbd &
sleep 2
echo w > /proc/sysrq-trigger
then the following appears in the kernel log:
sysrq: Show Blocked State
task:(udev-worker) state:D stack:0 pid:3121 tgid:3121
ppid:2191 fl
ags:0x00000006
Call Trace:
<TASK>
__schedule+0x3e8/0x1410
schedule+0x27/0xf0
blk_mq_freeze_queue_wait+0x6f/0xa0
queue_attr_store+0x60/0xc0
kernfs_fop_write_iter+0x13e/0x1f0
vfs_write+0x25b/0x420
ksys_write+0x65/0xe0
do_syscall_64+0x82/0x160
entry_SYSCALL_64_after_hwframe+0x76/0x7e
Do you agree that the above indicates that blk_mq_freeze_queue_wait()
hangs? I think it is waiting for a q_usage_counter reference that is
held by a bio on a zwplug->bio_list.
Do you agree that the best way to solve this is to modify
blk_mq_submit_bio() by moving the blk_zone_plug_bio() call after the
blk_crypto_rq_get_keyslot() call and also to change the zwplug bio list
into a request list?
If you agree with the above, do you want to implement these changes or
do you perhaps prefer that I implement these changes myself?
Thanks,
Bart.