From b4c5e1acb5a7964f858e2b41c1ae07b1afc0f4ea Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 25 Oct 2007 18:44:45 +0200 Subject: [PATCH] More cpu engine fixes Signed-off-by: Jens Axboe --- fio.c | 8 +++++--- io_u.c | 3 +++ memory.c | 3 +++ stat.c | 3 ++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/fio.c b/fio.c index 0ec4f5a0..6f9a378b 100644 --- a/fio.c +++ b/fio.c @@ -657,10 +657,12 @@ static int init_io_u(struct thread_data *td) memset(io_u, 0, sizeof(*io_u)); INIT_LIST_HEAD(&io_u->list); - io_u->buf = p + max_bs * i; + if (!(td->io_ops->flags & FIO_NOIO)) { + io_u->buf = p + max_bs * i; - if (td_write(td)) - fill_io_buf(td, io_u, max_bs); + if (td_write(td)) + fill_io_buf(td, io_u, max_bs); + } io_u->index = i; io_u->flags = IO_U_F_FREE; diff --git a/io_u.c b/io_u.c index 4750ac60..cab09800 100644 --- a/io_u.c +++ b/io_u.c @@ -313,6 +313,9 @@ void requeue_io_u(struct thread_data *td, struct io_u **io_u) static int fill_io_u(struct thread_data *td, struct io_u *io_u) { + if (td->io_ops->flags & FIO_NOIO) + goto out; + /* * see if it's time to sync */ diff --git a/memory.c b/memory.c index c147229e..5678350f 100644 --- a/memory.c +++ b/memory.c @@ -145,6 +145,9 @@ int allocate_io_mem(struct thread_data *td) { int ret = 0; + if (td->io_ops->flags & FIO_NOIO) + return 0; + if (td->o.mem_type == MEM_MALLOC) ret = alloc_mem_malloc(td); else if (td->o.mem_type == MEM_SHM || td->o.mem_type == MEM_SHMHUGE) diff --git a/stat.c b/stat.c index e858d59d..604c235b 100644 --- a/stat.c +++ b/stat.c @@ -293,7 +293,8 @@ static void show_thread_status(struct thread_stat *ts, double io_u_lat_u[FIO_IO_U_LAT_U_NR]; double io_u_lat_m[FIO_IO_U_LAT_M_NR]; - if (!(ts->io_bytes[0] + ts->io_bytes[1])) + if (!(ts->io_bytes[0] + ts->io_bytes[1]) && + !(ts->total_io_u[0] + ts->total_io_u[1])) return; if (!ts->error) -- 2.25.1