[PATCH] fio: rename delaysleep to thinktime and update docu
authorJens Axboe <axboe@suse.de>
Fri, 28 Oct 2005 14:34:02 +0000 (16:34 +0200)
committerJens Axboe <axboe@suse.de>
Fri, 28 Oct 2005 14:34:02 +0000 (16:34 +0200)
README.fio
fio.c

index 0f895ce47dbb536a326665676132b4ac214e1b71..22e9c9c12246e62bf0e25ed1c8758b1259d7edaa 100644 (file)
@@ -31,7 +31,7 @@ The <jobs> format is as follows:
        bs=x            Thread blocksize is x bytes
        bsrange=x-y     Mix thread block sizes randomly between x and y
        direct=x        1 for direct IO, 0 for buffered IO
-       delay=x         Delay x useconds before each io
+       thinktime=x     "Think" x usec after each io
        random          IO is randomized
        sequential      IO is sequential
        rate=x          Throttle rate to x KiB/sec
diff --git a/fio.c b/fio.c
index 38fc684663cfd0f9d56ca45903ad7a77dc6ae725..0364ffa35caf033cb798415bd37c08074dc9bb06 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -219,7 +219,7 @@ struct thread_data {
        unsigned int min_bs;
        unsigned int max_bs;
        unsigned int odirect;
-       unsigned int delay_sleep;
+       unsigned int thinktime;
        unsigned int fsync_blocks;
        unsigned int start_delay;
        unsigned int timeout;
@@ -611,9 +611,6 @@ static void do_sync_io(struct thread_data *td)
                        }
                }
 
-               if (td->delay_sleep)
-                       usec_sleep(td->delay_sleep);
-
                if (td_read(td))
                        ret = read(td->fd, io_u->buf, io_u->buflen);
                else
@@ -651,6 +648,9 @@ static void do_sync_io(struct thread_data *td)
                if (runtime_exceeded(td, &e))
                        break;
 
+               if (td->thinktime)
+                       usec_sleep(td->thinktime);
+
                put_io_u(td, io_u);
        }
 
@@ -755,9 +755,6 @@ static void do_async_io(struct thread_data *td)
                if (td->terminate)
                        break;
 
-               if (td->delay_sleep)
-                       usec_sleep(td->delay_sleep);
-
                io_u = get_io_u(td);
                if (!io_u)
                        break;
@@ -773,6 +770,8 @@ static void do_async_io(struct thread_data *td)
 
                gettimeofday(&io_u->issue_time, NULL);
                add_slat_sample(td, mtime_since(&io_u->start_time, &io_u->issue_time));
+               if (td->thinktime)
+                       usec_sleep(td->thinktime);
 
                if (td->cur_depth < td->aio_depth) {
                        timeout = &ts;
@@ -1249,7 +1248,7 @@ static struct thread_data *get_new_job(int global)
        td->min_bs = def_thread.min_bs;
        td->max_bs = def_thread.max_bs;
        td->odirect = def_thread.odirect;
-       td->delay_sleep = def_thread.delay_sleep;
+       td->thinktime = def_thread.thinktime;
        td->fsync_blocks = def_thread.fsync_blocks;
        td->start_delay = def_thread.start_delay;
        td->timeout = def_thread.timeout;
@@ -1456,11 +1455,11 @@ static void parse_jobs_cmd(int argc, char *argv[], int index)
                                td->sync_io = 0;
                }
 
-               c = strstr(p, "delay=");
+               c = strstr(p, "thinktime=");
                if (c) {
-                       c += 6;
+                       c += 10;
                        fill_option(c, string);
-                       td->delay_sleep = strtoul(string, NULL, 10);
+                       td->thinktime = strtoul(string, NULL, 10);
                }
 
                c = strstr(p, "rate=");
@@ -1741,7 +1740,7 @@ static int parse_jobs_ini(char *file)
                                fgetpos(f, &off);
                                continue;
                        }
-                       if (!check_int(p, "delay", &td->delay_sleep)) {
+                       if (!check_int(p, "thinktime", &td->thinktime)) {
                                fgetpos(f, &off);
                                continue;
                        }