Ensure we inherit global latency/bw log settings
[fio.git] / backend.c
index 12c76d8545ef53a02b95223ca8d53237b3175ef4..1ff8b3f6e298adfa7f756453edf2cff1656b91f8 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -623,6 +623,19 @@ reap:
        dprint(FD_VERIFY, "exiting loop\n");
 }
 
+static unsigned int exceeds_number_ios(struct thread_data *td)
+{
+       unsigned long long number_ios;
+
+       if (!td->o.number_ios)
+               return 0;
+
+       number_ios = ddir_rw_sum(td->this_io_blocks);
+       number_ios += td->io_u_queued + td->io_u_in_flight;
+
+       return number_ios >= td->o.number_ios;
+}
+
 static int io_bytes_exceeded(struct thread_data *td)
 {
        unsigned long long bytes;
@@ -636,7 +649,7 @@ static int io_bytes_exceeded(struct thread_data *td)
        else
                bytes = td->this_io_bytes[DDIR_TRIM];
 
-       return bytes >= td->o.size;
+       return bytes >= td->o.size || exceeds_number_ios(td);
 }
 
 /*
@@ -1127,6 +1140,8 @@ static int keep_running(struct thread_data *td)
                td->o.loops--;
                return 1;
        }
+       if (exceeds_number_ios(td))
+               return 0;
 
        if (td->o.size != -1ULL && ddir_rw_sum(td->io_bytes) < td->o.size) {
                uint64_t diff;
@@ -1196,6 +1211,12 @@ static uint64_t do_dry_run(struct thread_data *td)
                        td->ts.total_io_u[io_u->ddir]++;
                }
 
+               if (td_write(td) && io_u->ddir == DDIR_WRITE &&
+                   td->o.do_verify &&
+                   td->o.verify != VERIFY_NONE &&
+                   !td->o.experimental_verify)
+                       log_io_piece(td, io_u);
+
                ret = io_u_sync_complete(td, io_u, bytes_done);
                (void) ret;
        }
@@ -1279,7 +1300,7 @@ static void *thread_main(void *data)
         */
        if (o->cpumask_set) {
                if (o->cpus_allowed_policy == FIO_CPUS_SPLIT) {
-                       ret = fio_cpus_split(&o->cpumask, td->thread_number);
+                       ret = fio_cpus_split(&o->cpumask, td->thread_number - 1);
                        if (!ret) {
                                log_err("fio: no CPUs set\n");
                                log_err("fio: Try increasing number of available CPUs\n");