The only reason TD_F_NOIO exists in addition to FIO_NOIO is because
fio_running_or_pending_io_threads() needs to know whether td has
successfully initialized ioengine, whereas FIO_NOIO is statically
set regardless of ioengines's ->init() result.
This commit adds a new td field ->io_ops_init to inidicate ->init()
result, so that td needs no extra bit field for each ioengine like
TD_F_NOIO. It was rather odd that td was unable to tell ->init()
result afterward when ->init() failure (returning non zero) doesn't
mean aborting fio itself. This commit also changes TD_F_NOIO to
TD_F_RESERVED as it's no longer used.
Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
TD_F_VER_NONE = 1U << 5,
TD_F_PROFILE_OPS = 1U << 6,
TD_F_COMPRESS = 1U << 7,
TD_F_VER_NONE = 1U << 5,
TD_F_PROFILE_OPS = 1U << 6,
TD_F_COMPRESS = 1U << 7,
+ TD_F_RESERVED = 1U << 8, /* not used */
TD_F_COMPRESS_LOG = 1U << 9,
TD_F_VSTATE_SAVED = 1U << 10,
TD_F_NEED_LOCK = 1U << 11,
TD_F_COMPRESS_LOG = 1U << 9,
TD_F_VSTATE_SAVED = 1U << 10,
TD_F_NEED_LOCK = 1U << 11,
* to any of the available IO engines.
*/
struct ioengine_ops *io_ops;
* to any of the available IO engines.
*/
struct ioengine_ops *io_ops;
/*
* IO engine private data and dlhandle.
/*
* IO engine private data and dlhandle.
copy_opt_list(td, parent);
td->io_ops = NULL;
copy_opt_list(td, parent);
td->io_ops = NULL;
if (!preserve_eo)
td->eo = NULL;
if (!preserve_eo)
td->eo = NULL;
if (td->io_ops->init) {
ret = td->io_ops->init(td);
if (td->io_ops->init) {
ret = td->io_ops->init(td);
- if (ret && td->o.iodepth > 1) {
- log_err("fio: io engine init failed. Perhaps try"
- " reducing io depth?\n");
- }
+ if (ret)
+ log_err("fio: io engine %s init failed.%s\n",
+ td->io_ops->name,
+ td->o.iodepth > 1 ?
+ " Perhaps try reducing io depth?" : "");
+ else
+ td->io_ops_init = 1;
if (!td->error)
td->error = ret;
}
if (!td->error)
td->error = ret;
}
- if (!ret && td_ioengine_flagged(td, FIO_NOIO))
- td->flags |= TD_F_NOIO;
-
int nr_io_threads = 0;
for_each_td(td, i) {
int nr_io_threads = 0;
for_each_td(td, i) {
- if (td->flags & TD_F_NOIO)
+ if (td->io_ops_init && td_ioengine_flagged(td, FIO_NOIO))
continue;
nr_io_threads++;
if (td->runstate < TD_EXITED)
continue;
nr_io_threads++;
if (td->runstate < TD_EXITED)