Fix disk utilization for delayed jobs
authorJens Axboe <jaxboe@fusionio.com>
Thu, 8 Sep 2011 12:30:24 +0000 (14:30 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Thu, 8 Sep 2011 12:30:24 +0000 (14:30 +0200)
We initialized it all before starting the jobs, so we would
easily see disk stats that were too low for jobs that ended
up being started later.

Fix this by moving the disk util init right before the jobs
are spawned.

Reported-by: Shrirang Phansalkar <sphansalkar@stec-inc.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
fio.c

diff --git a/fio.c b/fio.c
index 4514840dbb11027da8127a64e379ddb21d7acd4f..b492889f740b1745922fe2fb0a2388b73d91f7b2 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -1502,10 +1502,8 @@ static void run_threads(void)
        for_each_td(td, i) {
                print_status_init(td->thread_number - 1);
 
        for_each_td(td, i) {
                print_status_init(td->thread_number - 1);
 
-               if (!td->o.create_serialize) {
-                       init_disk_util(td);
+               if (!td->o.create_serialize)
                        continue;
                        continue;
-               }
 
                /*
                 * do file setup here so it happens sequentially,
 
                /*
                 * do file setup here so it happens sequentially,
@@ -1533,8 +1531,6 @@ static void run_threads(void)
                                        td_io_close_file(td, f);
                        }
                }
                                        td_io_close_file(td, f);
                        }
                }
-
-               init_disk_util(td);
        }
 
        set_genesis_time();
        }
 
        set_genesis_time();
@@ -1573,6 +1569,8 @@ static void run_threads(void)
                                break;
                        }
 
                                break;
                        }
 
+                       init_disk_util(td);
+
                        /*
                         * Set state to created. Thread will transition
                         * to TD_INITIALIZED when it's done setting up.
                        /*
                         * Set state to created. Thread will transition
                         * to TD_INITIALIZED when it's done setting up.