engines/cpu: fix potential overflow in thinktime calculation
authorJens Axboe <axboe@kernel.dk>
Sun, 30 Sep 2018 14:41:40 +0000 (08:41 -0600)
committerJens Axboe <axboe@kernel.dk>
Sun, 30 Sep 2018 14:41:40 +0000 (08:41 -0600)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/cpu.c

index 0987250..4d572b4 100644 (file)
@@ -85,7 +85,7 @@ static int fio_cpuio_init(struct thread_data *td)
         */
        o->thinktime_blocks = 1;
        o->thinktime_spin = 0;
-       o->thinktime = (co->cpucycle * (100 - co->cpuload)) / co->cpuload;
+       o->thinktime = ((unsigned long long) co->cpucycle * (100 - co->cpuload)) / co->cpuload;
 
        o->nr_files = o->open_files = 1;