io_uring: Add support for 'zone_append' when using uring_cmd and zonemode ZBD#2103
io_uring: Add support for 'zone_append' when using uring_cmd and zonemode ZBD#2103Krien wants to merge 2 commits into
Conversation
When using uring_cmd use fio_ioring_cmd_finish_zone instead of the finish command from blkzone, which is supposed to be used with block devices. Signed-off-by: Krijn Doekemeijer <krijn.doekemeijer@wdc.com>
58ae1f5 to
0151b74
Compare
|
@damien-lemoal @kawasaki Do you have any feedback on this? |
damien-lemoal
left a comment
There was a problem hiding this comment.
Looks OK to me, except for one nit.
| /* Zone appends must be issued to the start of the target zone */ | ||
| if (cmd->opcode == nvme_zns_cmd_append && io_u->file->zbd_info) { | ||
| zone_size = io_u->file->zbd_info->zone_size; | ||
| offset = (io_u->offset / zone_size) * zone_size; |
There was a problem hiding this comment.
offset = io_u->offset & (~(zone_size - 1));
Because the zone size is always a power of 2. So let's avoid the expensive divisions.
|
|
||
| /* If the file is not yet opened, open it for this function. */ | ||
| fd = f->fd; | ||
| if (fd < 0) { |
There was a problem hiding this comment.
How can that happen ? The file should already be open since IOs are on-going. No ?
There was a problem hiding this comment.
I agree that it should not happen. I followed the same if statement used in blkzoned_finish_zone to ensure consistent behavior. If this is not desirable, I will remove the if.
|
Note: patches on the mailing list would be a lot easier to review/comment. The github GUI is really horrendous for reviews :( |
| FIO_URING_CMD_WMODE_ZONE_APPEND, | ||
| }; | ||
|
|
||
| #define WMODE_SPLIT_MAX 4 |
There was a problem hiding this comment.
This should be increased by one.
Better yet, set FIO_URING_CMD_WMODE_WRITE = 0, add FIO_URING_CMD_WMODE_LAST at the end of the enum, and #define WMODE_SPLIT_MAX FIO_URING_CMD_WMODE_LAST so that this value is automatically updated.
Fio does something similar with enum fio_ddir.
Add a new write mode 'zone_append' for io_uring_cmd that uses zone_appends instead of writes when ZBD is enabled. Zone appends are issued to the start of zones. Signed-off-by: Krijn Doekemeijer <krijn.doekemeijer@wdc.com>
This pull request adds support for zone appends for NVMe ZNS devices. Zone appends enable an iodepth larger than 1 for writes within zones. It only supports uring_cmd as appends can not yet be used in the standard write path (see #1026) and appends can only be enabled when the zonemode is explicitly set to ZBD.
The request introduces the following changes: