From: Jens Axboe Date: Sun, 30 Sep 2018 14:41:40 +0000 (-0600) Subject: engines/cpu: fix potential overflow in thinktime calculation X-Git-Tag: fio-3.11~6 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=2bce52c621f0e1d7a360e8aedfe23300f8e56bb9 engines/cpu: fix potential overflow in thinktime calculation Signed-off-by: Jens Axboe --- diff --git a/engines/cpu.c b/engines/cpu.c index 09872508..4d572b44 100644 --- a/engines/cpu.c +++ b/engines/cpu.c @@ -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;