init: don't adjust time units again for subjobs
authorVincent Fu <vincent.fu@samsung.com>
Tue, 20 Jun 2023 18:11:36 +0000 (14:11 -0400)
committerVincent Fu <vincent.fu@samsung.com>
Tue, 20 Jun 2023 18:11:36 +0000 (14:11 -0400)
We adjust max_latency and latency_target values to be nsec internally.
Make sure we do this only once for the parent job and don't do it a
second time for a subjob.

Fixes: https://github.com/axboe/fio/issues/1582
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
init.c

diff --git a/init.c b/init.c
index 437406ecaea5aeb31ab368cd680d1fa0989726bf..10e63cca6cf7fd738a20b9c329357e5eb158fab5 100644 (file)
--- a/init.c
+++ b/init.c
@@ -951,13 +951,16 @@ static int fixup_options(struct thread_data *td)
        if (o->disable_slat)
                o->slat_percentiles = 0;
 
-       /*
-        * Fix these up to be nsec internally
-        */
-       for_each_rw_ddir(ddir)
-               o->max_latency[ddir] *= 1000ULL;
+       /* Do this only for the parent job */
+       if (!td->subjob_number) {
+               /*
+                * Fix these up to be nsec internally
+                */
+               for_each_rw_ddir(ddir)
+                       o->max_latency[ddir] *= 1000ULL;
 
-       o->latency_target *= 1000ULL;
+               o->latency_target *= 1000ULL;
+       }
 
        /*
         * Dedupe working set verifications