Enable Flexible Data Placement mode for write commands.
+.. option:: fdp_pli_select=str : [io_uring_cmd]
+
+ Defines how fio decides which placement ID to use next. The following
+ types are defined:
+
+ **random**
+ Choose a placement ID at random (uniform).
+
+ **roundrobin**
+ Round robin over available placement IDs. This is the
+ default.
+
+ The available placement ID index/indices is defined by the option
+ :option:`fdp_pli`.
+
.. option:: fdp_pli=str : [io_uring_cmd]
Select which Placement ID Index/Indicies this job is allowed to use for
return;
}
- if (ruhs->pli_loc >= ruhs->nr_ruhs)
- ruhs->pli_loc = 0;
+ if (td->o.fdp_pli_select == FIO_FDP_RR) {
+ if (ruhs->pli_loc >= ruhs->nr_ruhs)
+ ruhs->pli_loc = 0;
+
+ dspec = ruhs->plis[ruhs->pli_loc++];
+ } else {
+ ruhs->pli_loc = rand_between(&td->fdp_state, 0, ruhs->nr_ruhs - 1);
+ dspec = ruhs->plis[ruhs->pli_loc];
+ }
- dspec = ruhs->plis[ruhs->pli_loc++];
io_u->dtype = FDP_DIR_DTYPE;
io_u->dspec = dspec;
}
#define FDP_DIR_DTYPE 2
#define FDP_MAX_RUHS 128
+/*
+ * How fio chooses what placement identifier to use next. Choice of
+ * uniformly random, or roundrobin.
+ */
+
+enum {
+ FIO_FDP_RANDOM = 0x1,
+ FIO_FDP_RR = 0x2,
+};
+
struct fio_ruhs_info {
uint32_t nr_ruhs;
uint32_t pli_loc;
.BI (io_uring_cmd)fdp \fR=\fPbool
Enable Flexible Data Placement mode for write commands.
.TP
+.BI (io_uring_cmd)fdp_pli_select \fR=\fPstr
+Defines how fio decides which placement ID to use next. The following types
+are defined:
+.RS
+.RS
+.TP
+.B random
+Choose a placement ID at random (uniform).
+.TP
+.B roundrobin
+Round robin over available placement IDs. This is the default.
+.RE
+.P
+The available placement ID index/indices is defined by \fBfdp_pli\fR option.
+.RE
+.TP
.BI (io_uring_cmd)fdp_pli \fR=\fPstr
Select which Placement ID Index/Indicies this job is allowed to use for writes.
By default, the job will cycle through all available Placement IDs, so use this
FIO_RAND_POISSON3_OFF,
FIO_RAND_PRIO_CMDS,
FIO_RAND_DEDUPE_WORKING_SET_IX,
+ FIO_RAND_FDP_OFF,
FIO_RAND_NR_OFFS,
};
struct frand_state verify_state_last_do_io;
struct frand_state trim_state;
struct frand_state delay_state;
+ struct frand_state fdp_state;
struct frand_state buf_state;
struct frand_state buf_state_prev;
init_rand_seed(&td->buf_state, td->rand_seeds[FIO_RAND_BUF_OFF], use64);
frand_copy(&td->buf_state_prev, &td->buf_state);
+
+ init_rand_seed(&td->fdp_state, td->rand_seeds[FIO_RAND_FDP_OFF], use64);
}
static int setup_random_seeds(struct thread_data *td)
.category = FIO_OPT_C_IO,
.group = FIO_OPT_G_INVALID,
},
+ {
+ .name = "fdp_pli_select",
+ .lname = "FDP Placement ID select",
+ .type = FIO_OPT_STR,
+ .off1 = offsetof(struct thread_options, fdp_pli_select),
+ .help = "Select which FDP placement ID to use next",
+ .def = "roundrobin",
+ .category = FIO_OPT_C_IO,
+ .group = FIO_OPT_G_INVALID,
+ .posval = {
+ { .ival = "random",
+ .oval = FIO_FDP_RANDOM,
+ .help = "Choose a Placement ID at random (uniform)",
+ },
+ { .ival = "roundrobin",
+ .oval = FIO_FDP_RR,
+ .help = "Round robin select Placement IDs",
+ },
+ },
+ },
{
.name = "fdp_pli",
.lname = "FDP Placement ID indicies",
#define FIO_MAX_PLIS 16
unsigned int fdp;
+ unsigned int fdp_pli_select;
unsigned int fdp_plis[FIO_MAX_PLIS];
unsigned int fdp_nrpli;
uint32_t log_prio;
uint32_t fdp;
+ uint32_t fdp_pli_select;
uint32_t fdp_plis[FIO_MAX_PLIS];
uint32_t fdp_nrpli;