When set, the queue's completion fd is enabled even when it isn't used,
i.e., even if option libblkio_wait_mode is _not_ set to "eventfd".
Depending on the libblkio driver, this can have an impact on
performance. This option allows evaluating that overhead.
Signed-off-by: Alberto Faria <afaria@redhat.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
[libblkio]
Use poll queues. This is incompatible with
[libblkio]
Use poll queues. This is incompatible with
- :option:`libblkio_wait_mode=eventfd <libblkio_wait_mode>`.
+ :option:`libblkio_wait_mode=eventfd <libblkio_wait_mode>` and
+ :option:`libblkio_force_enable_completion_eventfd`.
**loop**
Use a busy loop with a non-blocking call to ``blkioq_do_io()``.
**loop**
Use a busy loop with a non-blocking call to ``blkioq_do_io()``.
+.. option:: libblkio_force_enable_completion_eventfd : [libblkio]
+
+ Enable the queue's completion eventfd even when unused. This may impact
+ performance. The default is to enable it only if
+ :option:`libblkio_wait_mode=eventfd <libblkio_wait_mode>`.
+
struct fio_blkio_data {
struct blkio *b;
struct blkioq *q;
struct fio_blkio_data {
struct blkio *b;
struct blkioq *q;
- int completion_fd; /* -1 if not FIO_BLKIO_WAIT_MODE_EVENTFD */
+ int completion_fd; /* may be -1 if not FIO_BLKIO_WAIT_MODE_EVENTFD */
bool has_mem_region; /* whether mem_region is valid */
struct blkio_mem_region mem_region; /* only if allocated by libblkio */
bool has_mem_region; /* whether mem_region is valid */
struct blkio_mem_region mem_region; /* only if allocated by libblkio */
unsigned int vectored;
unsigned int write_zeroes_on_trim;
enum fio_blkio_wait_mode wait_mode;
unsigned int vectored;
unsigned int write_zeroes_on_trim;
enum fio_blkio_wait_mode wait_mode;
+ unsigned int force_enable_completion_eventfd;
};
static struct fio_option options[] = {
};
static struct fio_option options[] = {
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_LIBBLKIO,
},
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_LIBBLKIO,
},
+ {
+ .name = "libblkio_force_enable_completion_eventfd",
+ .lname = "Force enable the completion eventfd, even if unused",
+ .type = FIO_OPT_STR_SET,
+ .off1 = offsetof(struct fio_blkio_options,
+ force_enable_completion_eventfd),
+ .help = "This can impact performance",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_LIBBLKIO,
+ },
+ if (options->hipri && options->force_enable_completion_eventfd) {
+ log_err("fio: option hipri is incompatible with option libblkio_force_enable_completion_eventfd\n");
+ return 1;
+ }
+
if (fio_blkio_create_and_connect(td, &b) != 0)
return 1;
if (fio_blkio_create_and_connect(td, &b) != 0)
return 1;
else
data->q = blkio_get_queue(data->b, 0);
else
data->q = blkio_get_queue(data->b, 0);
- if (options->wait_mode == FIO_BLKIO_WAIT_MODE_EVENTFD) {
+ if (options->wait_mode == FIO_BLKIO_WAIT_MODE_EVENTFD ||
+ options->force_enable_completion_eventfd) {
/* enable completion fd and make it blocking */
blkioq_set_completion_fd_enabled(data->q, true);
data->completion_fd = blkioq_get_completion_fd(data->q);
/* enable completion fd and make it blocking */
blkioq_set_completion_fd_enabled(data->q, true);
data->completion_fd = blkioq_get_completion_fd(data->q);
\fIhttps://libblkio.gitlab.io/libblkio/blkio.html#properties\fR
.TP
.BI (libblkio)hipri
\fIhttps://libblkio.gitlab.io/libblkio/blkio.html#properties\fR
.TP
.BI (libblkio)hipri
-Use poll queues. This is incompatible with \fBlibblkio_wait_mode=eventfd\fR.
+Use poll queues. This is incompatible with \fBlibblkio_wait_mode=eventfd\fR and
+\fBlibblkio_force_enable_completion_eventfd\fR.
.TP
.BI (libblkio)libblkio_vectored
Submit vectored read and write requests.
.TP
.BI (libblkio)libblkio_vectored
Submit vectored read and write requests.
.TP
.B loop
Use a busy loop with a non-blocking call to \fBblkioq_do_io()\fR.
.TP
.B loop
Use a busy loop with a non-blocking call to \fBblkioq_do_io()\fR.
+.RE
+.RE
+.TP
+.BI (libblkio)libblkio_force_enable_completion_eventfd
+Enable the queue's completion eventfd even when unused. This may impact
+performance. The default is to enable it only if
+\fBlibblkio_wait_mode=eventfd\fR.
.SS "I/O depth"
.TP
.BI iodepth \fR=\fPint
.SS "I/O depth"
.TP
.BI iodepth \fR=\fPint