zbd: refer file->last_start[] instead of sectors with data accounting
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Thu, 9 Feb 2023 07:09:00 +0000 (16:09 +0900)
committerVincent Fu <vincent.fu@samsung.com>
Tue, 14 Feb 2023 14:52:52 +0000 (09:52 -0500)
commit440f63b11300ca0881a77004393e22cce9525b4e
tree1b1721e5c8db813300dcb47e9fd2708fdccfe6ef
parentb65023f3c8849e122b2a223838ae9fdaed994e84
zbd: refer file->last_start[] instead of sectors with data accounting

To decide the first IO direction of randrw workload, the function
zbd_adjust_ddir() refers to the zbd_info->sectors_with_data value which
indicates the number of bytes written to the zoned block devices being
accessed. However, this accounting has two issues. The first issue is
wrong accounting for multiple jobs with different write ranges. The
second issue is job start up failure due to zone lock contention.

Avoid using zbd_info->sectors_with_data and simply refer to file->
last_start[DDIR_WRITE] instead. It is initialized with -1ULL for each
job. After any write operation is done by the job, it keeps valid
offset. If it has valid offset, written data is expected and the first
IO direction can be read.

Also remove zbd_info->sectors_with_data, which is no longer used. Keep
the field zbd_info->wp_sectors_with_data since it is still used for
zones with write pointers.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
zbd.c
zbd.h