Fix regression introduced by commit 334185e
authorJens Axboe <axboe@fb.com>
Mon, 9 Jun 2014 19:25:13 +0000 (13:25 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 9 Jun 2014 19:25:13 +0000 (13:25 -0600)
We need to run fio_time_init() before the threads are invoked,
but we should do it in global context so that all threads share
the same clock and init settings.

Signed-off-by: Jens Axboe <axboe@fb.com>
backend.c
server.c

index d1d55718b32ecb76009c6adc3484decee2f3a626..23fa345b7e19496ae64af4a0bfa8983ddaefe794 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -1270,11 +1270,6 @@ static void *thread_main(void *data)
        } else
                td->pid = gettid();
 
-       /*
-        * fio_time_init() may not have been called yet if running as a server
-        */
-       fio_time_init();
-
        fio_local_clock_init(o->use_thread);
 
        dprint(FD_PROCESS, "jobs pid=%d started\n", (int) td->pid);
index 077dce5c349f67efec5c76a6371e89e2a2a4724f..8865502520cb7f1fe2a8315bf8c9c79c54e346a7 100644 (file)
--- a/server.c
+++ b/server.c
@@ -555,6 +555,7 @@ static int handle_run_cmd(struct flist_head *job_list, struct fio_net_cmd *cmd)
        pid_t pid;
        int ret;
 
+       fio_time_init();
        set_genesis_time();
 
        pid = fork();