Re: Zone write plugging and the queue full condition

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

 



On 11/23/24 12:08 PM, Bart Van Assche wrote:
> 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

Running this script, I never get out of this loop... Weird. I changed the
script to this:

...
while true; do
	bdev="$(lsscsi -g | grep scsi_debug | cut -d'/' -f3)"
	if [ ! -z "${bdev}" ]; then
		break;
       	fi
	sleep .1
done
dev="/dev/${bdev}"
[ -b "${dev}" ]
...

and then it runs, but I do not see anything blocked. All is fine. Could you
share your kernel config to see what I am missing may be ?

> 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?

I am not following... blk_zone_plug_bio() acts on BIOs, not on requests, but
blk_crypto_rq_get_keyslot() is a request operation. Also, a requeue list is a
list of requests, not BIOs. One of the main point of zone write plugs is to
operate on BIOs so that:
1) we have code that is common for regular block devices and for BIO based
device-mapper devices.
2) Blocking writes to preserve per-zone write ordering does not result in
device resources (TAGS !) being held for nothing and potentially
delaying/starving read accesses or other operations that do not need ordering.

How can a requeue list help ? Please provide details.

-- 
Damien Le Moal
Western Digital Research




[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