[PATCH] Total io size / eta fix
authorJens Axboe <jens.axboe@oracle.com>
Thu, 19 Oct 2006 18:37:12 +0000 (20:37 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 19 Oct 2006 18:37:12 +0000 (20:37 +0200)
Inadvertently the files were counted twice, hence ETA ended at 50%.
This was also the real bug for the verify ETA fixed a few days ago,
so reinstate the proper check when doing verifies as well.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
eta.c
filesetup.c

diff --git a/eta.c b/eta.c
index 9ad0b49bdb5b1798d5c3bbe77f9c5d08892f7a52..0eca3be0e345ee6c797f1d9f86f1ccbb9f6cd783 100644 (file)
--- a/eta.c
+++ b/eta.c
@@ -105,6 +105,17 @@ static int thread_eta(struct thread_data *td, unsigned long elapsed)
 
        bytes_total = td->total_io_size;
 
 
        bytes_total = td->total_io_size;
 
+       /*
+        * if writing, bytes_total will be twice the size. If mixing,
+        * assume a 50/50 split and thus bytes_total will be 50% larger.
+        */
+       if (td->verify) {
+               if (td_rw(td))
+                       bytes_total = bytes_total * 3 / 2;
+               else
+                       bytes_total <<= 1;
+       }
+
        if (td->zone_size && td->zone_skip)
                bytes_total /= (td->zone_skip / td->zone_size);
 
        if (td->zone_size && td->zone_skip)
                bytes_total /= (td->zone_skip / td->zone_size);
 
index 57735a96dacffe0e798b733b64f7f2dd187d97b2..327eb5ac8cf4dcab676f888cc9b2c663d791166d 100644 (file)
@@ -86,7 +86,6 @@ static int create_files(struct thread_data *td)
         * unless specifically asked for overwrite, let normal io extend it
         */
        if (!td->overwrite) {
         * unless specifically asked for overwrite, let normal io extend it
         */
        if (!td->overwrite) {
-               td->io_size = td->total_file_size;
                for_each_file(td, f, i)
                        f->file_size = td->total_file_size / td->nr_files;
 
                for_each_file(td, f, i)
                        f->file_size = td->total_file_size / td->nr_files;
 
@@ -109,10 +108,9 @@ static int create_files(struct thread_data *td)
                err = create_file(td, f);
                if (err)
                        break;
                err = create_file(td, f);
                if (err)
                        break;
-
-               td->io_size += f->file_size;
        }
 
        }
 
+       td->io_size = td->total_file_size;
        temp_stall_ts = 0;
        return err;
 }
        temp_stall_ts = 0;
        return err;
 }
@@ -179,7 +177,6 @@ static int get_file_size(struct thread_data *td, struct fio_file *f)
                return 1;
        }
 
                return 1;
        }
 
-       td->io_size += f->file_size;
        return 0;
 }
 
        return 0;
 }