Skip to content

Commit

Permalink
engines/io_uring_cmd: add option to set DEAC bit for write zeroes
Browse files Browse the repository at this point in the history
Add an option for fio to set the DEAC bit for write zeroes commands.
This instructs the device to also deallocate the specified logical
blocks in the course of completing the write zeroes operation. This only
has an effect when write_mode=zeroes is specified.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
  • Loading branch information
vincentkfu committed Oct 10, 2024
1 parent cd56c0a commit ad84e7c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions engines/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ struct ioring_options {
unsigned int hipri;
unsigned int readfua;
unsigned int writefua;
unsigned int deac;
unsigned int write_mode;
unsigned int verify_mode;
struct cmdprio_options cmdprio_options;
Expand Down Expand Up @@ -357,6 +358,16 @@ static struct fio_option options[] = {
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_IOURING,
},
{
.name = "deac",
.lname = "Deallocate bit for write zeroes command",
.type = FIO_OPT_BOOL,
.off1 = offsetof(struct ioring_options, deac),
.help = "Set DEAC (deallocate) flag for write zeroes command",
.def = "0",
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_IOURING,
},
{
.name = NULL,
},
Expand Down Expand Up @@ -1388,6 +1399,8 @@ static int fio_ioring_init(struct thread_data *td)
break;
case FIO_URING_CMD_WMODE_ZEROES:
ld->write_opcode = nvme_cmd_write_zeroes;
if (o->deac)
ld->cdw12_flags[DDIR_WRITE] = 1 << 25;
break;
case FIO_URING_CMD_WMODE_VERIFY:
ld->write_opcode = nvme_cmd_verify;
Expand Down

0 comments on commit ad84e7c

Please sign in to comment.