zbd: Support zone capacity smaller than zone size
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fri, 17 Jul 2020 09:36:32 +0000 (18:36 +0900)
committerJens Axboe <axboe@kernel.dk>
Tue, 21 Jul 2020 15:17:29 +0000 (09:17 -0600)
commit236d23a86d6e3c14b700496e0f196f88513a5f3e
treefc96baccbcc54a66e678efbf15276696e8015d2b
parentd13596b225baf61425a9ca92b0583fc3fa97765d
zbd: Support zone capacity smaller than zone size

NVMe ZNS specification defines zone capacity. The report zone interface
of Linux kernel supports it. This patch adds support for this new
interface.

Modify configure to check availability of BLK_ZONE_REP_CAPACITY flag as
well as blkzoned.h header only when target OS is Linux. If this flag is
defined and set in the report zone, all sectors from the zone capacity up
to the zone size are not accessible. Prevent read and write operations to
these sectors by modifying zbd_adjust_block(). Of note is that this skips
the region between zone capacity and zone size then reduces total I/O
bytes of sequential workloads.

Introduce helper functions zbd_zone_end() and zbd_zone_capacity_end() to
improve readability of zone limit check code.

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Aravind Ramesh <aravind.ramesh@wdc.com>
Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
configure
engines/libzbc.c
oslib/linux-blkzoned.c
zbd.c
zbd.h
zbd_types.h