> -----Original Message----- > From: Shin'ichiro Kawasaki [mailto:shinichiro.kawasaki@xxxxxxx] > Sent: Friday, October 28, 2022 7:54 AM > To: fio@xxxxxxxxxxxxxxx; Jens Axboe <axboe@xxxxxxxxx>; Vincent Fu > <vincentfu@xxxxxxxxx> > Cc: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx>; Dmitry > Fomichev <Dmitry.Fomichev@xxxxxxx>; Niklas Cassel > <niklas.cassel@xxxxxxx>; Shin'ichiro Kawasaki > <shinichiro.kawasaki@xxxxxxx> > Subject: [PATCH v3 06/13] zbd: verify before zone reset for > zone_reset_threshold option > > When verify option is specified together with zonemode=zbd and > zone_reset_threshold option, zone reset happens to zones not full. This > erases data for verify and causes verify failure. Current implementation > avoids this scenario by assert. > > To allow zone_reset_threshold option together with zonemode=zbd and > verify option, do verify before the zone reset. When zone reset is > required to an open zone with verify data, call get_next_verify() to > get verify read unit and return it from zbd_adjust_block(). > > Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx> > Tested-by: Dmitry Fomichev <dmitry.fomichev@xxxxxxx> > Reviewed-by: Dmitry Fomichev <dmitry.fomichev@xxxxxxx> > --- > zbd.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/zbd.c b/zbd.c > index 6f4e5ab2..af761c17 100644 > --- a/zbd.c > +++ b/zbd.c > @@ -2032,7 +2032,10 @@ retry: > > /* Reset the zone pointer if necessary */ > if (zb->reset_zone || zbd_zone_full(f, zb, min_bs)) { > - assert(td->o.verify == VERIFY_NONE); > + if (td->o.verify != VERIFY_NONE && > + !get_next_verify(td, io_u)) > + goto accept; > + > /* > * Since previous write requests may have been > submitted > * asynchronously and since we will submit the > zone > -- > 2.37.1 The new test case 59 assesses the above functionality with a sequential write workload. But when I try a random write workload, it seems like randomly generated write offsets may no longer be changed to a zone write pointer. Am I missing something? # uname -a Linux ubuntu 6.0.0 #1 SMP PREEMPT_DYNAMIC Tue Nov 1 13:49:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux # modprobe null_blk zoned=1 gb=1 memory_backed=1 # ./fio --name=test --filename=/dev/nullb0 --zonemode=zbd --bs=64M --rw=randwrite --direct=1 --verify=crc32c --zone_reset_threshold=0.1 --zone_reset_frequency=1 --debug=io,zbd fio: set debug option io fio: set debug option zbd test: (g=0): rw=randwrite, bs=(R) 64.0MiB-64.0MiB, (W) 64.0MiB-64.0MiB, (T) 64.0MiB-64.0MiB, ioengine=psync, iodepth=1 fio-3.30-223-g33796 Starting 1 process zbd 4343 /dev/nullb0: zbd model string: host-managed zbd 4343 Device /dev/nullb0 has 4 zones of size 262144 KB zbd 4343 /dev/nullb0: max open zones supported by device: 0 zbd 4343 /dev/nullb0: using max open zones limit: 0 zbd 4345 zbd_file_reset(/dev/nullb0): swd = 134217728 zbd 4345 /dev/nullb0: examining zones 0 .. 4 zbd 4345 /dev/nullb0: resetting zone 0 zbd 4345 /dev/nullb0: resetting wp of zone 0. zbd 4345 /dev/nullb0: resetting zone 2 zbd 4345 /dev/nullb0: resetting wp of zone 2. io 4345 drop page cache /dev/nullb0 io 4345 fill: io_u 0x55cc663f3180: off=0x0,len=0x4000000,ddir=1,file=/dev/nullb0 io 4345 prep: io_u 0x55cc663f3180: off=0x0,len=0x4000000,ddir=1,file=/dev/nullb0 io 4345 queue: io_u 0x55cc663f3180: off=0x0,len=0x4000000,ddir=1,file=/dev/nullb0 zbd 4345 /dev/nullb0: queued I/O (0, 67108864) for zone 0 io 4345 complete: io_u 0x55cc663f3180: off=0x0,len=0x4000000,ddir=1,file=/dev/nullb0 io 4345 fill: io_u 0x55cc663f3180: off=0x20000000,len=0x4000000,ddir=1,file=/dev/nullb0 io 4345 prep: io_u 0x55cc663f3180: off=0x20000000,len=0x4000000,ddir=1,file=/dev/nullb0 io 4345 queue: io_u 0x55cc663f3180: off=0x20000000,len=0x4000000,ddir=1,file=/dev/nullb0 zbd 4345 /dev/nullb0: queued I/O (536870912, 67108864) for zone 2 io 4345 complete: io_u 0x55cc663f3180: off=0x20000000,len=0x4000000,ddir=1,file=/dev/nullb0 io 4345 fill: io_u 0x55cc663f3180: off=0x34000000,len=0x4000000,ddir=1,file=/dev/nullb0 io 4345 prep: io_u 0x55cc663f3180: off=0x34000000,len=0x4000000,ddir=1,file=/dev/nullb0 io 4345 queue: io_u 0x55cc663f3180: off=0x34000000,len=0x4000000,ddir=1,file=/dev/nullb0 fio: io_u error on file /dev/nullb0: Input/output error: write offset=872415232, buflen=67108864 io 4345 io_u_queued_complete: min=0 io 4345 getevents: 0 fio: pid=4345, err=5/file:io_u.c:1876, func=io_u error, error=Input/output error io 4345 close ioengine psync io 4345 free ioengine psync test: (groupid=0, jobs=1): err= 5 (file:io_u.c:1876, func=io_u error, error=Input/output error): pid=4345: Tue Nov 1 14:15:31 2022 write: IOPS=10, BW=432MiB/s (453MB/s)(128MiB/296msec); 2 zone resets clat (usec): min=73204, max=79962, avg=76583.41, stdev=4778.37 lat (msec): min=102, max=112, avg=107.51, stdev= 7.04 clat percentiles (usec): | 1.00th=[72877], 5.00th=[72877], 10.00th=[72877], 20.00th=[72877], | 30.00th=[72877], 40.00th=[72877], 50.00th=[72877], 60.00th=[80217], | 70.00th=[80217], 80.00th=[80217], 90.00th=[80217], 95.00th=[80217], | 99.00th=[80217], 99.50th=[80217], 99.90th=[80217], 99.95th=[80217], | 99.99th=[80217] lat (msec) : 100=66.67% cpu : usr=29.49%, sys=4.41%, ctx=133, majf=0, minf=18 IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0% submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0% complete : 0=25.0%, 4=75.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0% issued rwts: total=0,3,0,0 short=0,0,0,0 dropped=0,0,0,0 latency : target=0, window=0, percentile=100.00%, depth=1 Run status group 0 (all jobs): WRITE: bw=432MiB/s (453MB/s), 432MiB/s-432MiB/s (453MB/s-453MB/s), io=128MiB (134MB), run=296-296msec Disk stats (read/write): nullb0: ios=0/91, merge=0/0, ticks=0/435, in_queue=435, util=19.92%