engines/filecreate: set FIO_NOSTATS flag
authorJens Axboe <axboe@kernel.dk>
Mon, 9 Oct 2017 16:11:19 +0000 (10:11 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 Oct 2017 16:12:52 +0000 (10:12 -0600)
Before this change, we bundle the fake IO latencies with the file
open latencies. That's not intended. Add a flag for IO engines to
tell the core to ignore any IO latencies.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/filecreate.c
io_u.c
ioengines.h

index 171dcc95b025d9331d9158a57acde012e482737e..01f7d68f4073e0fe41131fd5652e5604b5161b21 100644 (file)
@@ -76,7 +76,8 @@ static struct ioengine_ops ioengine = {
        .get_file_size  = get_file_size,
        .open_file      = open_file,
        .close_file     = generic_close_file,
        .get_file_size  = get_file_size,
        .open_file      = open_file,
        .close_file     = generic_close_file,
-       .flags          = FIO_DISKLESSIO | FIO_SYNCIO | FIO_FAKEIO,
+       .flags          = FIO_DISKLESSIO | FIO_SYNCIO | FIO_FAKEIO |
+                               FIO_NOSTATS,
 };
 
 static void fio_init fio_filecreate_register(void)
 };
 
 static void fio_init fio_filecreate_register(void)
diff --git a/io_u.c b/io_u.c
index 58c23202bd3d20bb1eee1b4fbcf1731d9bf312ea..fb4180a3bc35f16cf6a0463b01be1ff9b9e7f347 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1779,7 +1779,7 @@ static void account_io_completion(struct thread_data *td, struct io_u *io_u,
        if (td->parent)
                td = td->parent;
 
        if (td->parent)
                td = td->parent;
 
-       if (!td->o.stats)
+       if (!td->o.stats || td_ioengine_flagged(td, FIO_NOSTATS))
                return;
 
        if (no_reduce)
                return;
 
        if (no_reduce)
index 177cbc053c33ba8aedf7dbb092d15bdc92b58ccb..e744f3f84d3cd7568a0415ce5cd6c8f8a75f19c5 100644 (file)
@@ -59,6 +59,7 @@ enum fio_ioengine_flags {
        FIO_MEMALIGN    = 1 << 9,       /* engine wants aligned memory */
        FIO_BIT_BASED   = 1 << 10,      /* engine uses a bit base (e.g. uses Kbit as opposed to KB) */
        FIO_FAKEIO      = 1 << 11,      /* engine pretends to do IO */
        FIO_MEMALIGN    = 1 << 9,       /* engine wants aligned memory */
        FIO_BIT_BASED   = 1 << 10,      /* engine uses a bit base (e.g. uses Kbit as opposed to KB) */
        FIO_FAKEIO      = 1 << 11,      /* engine pretends to do IO */
+       FIO_NOSTATS     = 1 << 12,      /* don't do IO stats */
 };
 
 /*
 };
 
 /*