Skip to content

Commit

Permalink
engines/io_uring_cmd: do not send data buffer for write zeroes
Browse files Browse the repository at this point in the history
For write zeroes commands, do not send a data bufffer address. If we do
send an address, the driver will try to carry out DMA mapping and
encounter driver mdts limitations which do not apply to write zeroes
commands. This lets us send large write zeroes commands to deallocate
the device with the deac=1.

This is only done for the non-vectored IO case. For the vectored IO
case, the driver requires data buffer addresses to be sent. Regardless
it does not make sense to use vectored IO for write zeroes.

Signed-off-by: Vincent Fu <[email protected]>
  • Loading branch information
vincentkfu committed Oct 28, 2024
1 parent dfc79b1 commit a191635
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion engines/nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,11 @@ int fio_nvme_uring_cmd_prep(struct nvme_uring_cmd *cmd, struct io_u *io_u,
cmd->addr = (__u64)(uintptr_t)iov;
cmd->data_len = 1;
} else {
cmd->addr = (__u64)(uintptr_t)io_u->xfer_buf;
/* no buffer for write zeroes */
if (cmd->opcode != nvme_cmd_write_zeroes)
cmd->addr = (__u64)(uintptr_t)io_u->xfer_buf;
else
cmd->addr = (__u64)(uintptr_t)NULL;
cmd->data_len = io_u->xfer_buflen;
}
if (data->lba_shift && data->ms) {
Expand Down

0 comments on commit a191635

Please sign in to comment.