From: Yufei Ren Date: Sat, 20 Oct 2012 03:11:49 +0000 (-0400) Subject: cpuio engine cpuload bug fix X-Git-Tag: fio-2.0.11~51 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=2557f7e66176884783053fc44bda91a6781a3725;ds=sidebyside cpuio engine cpuload bug fix Current cpu ioengine always bruns out 100 percent cpu cycles no matter what the cpuload value is. Since no data is transferred with cpuio, bytes_done would be ZERO. Consequently, think_time is omitted and loops keeps running. A cpuio example is added as well. Signed-off-by: Jens Axboe --- diff --git a/engines/cpu.c b/engines/cpu.c index 8bc9fd5c..322dfde7 100644 --- a/engines/cpu.c +++ b/engines/cpu.c @@ -10,6 +10,11 @@ static int fio_cpuio_queue(struct thread_data *td, struct io_u fio_unused *io_u) { usec_spin(td->o.cpucycle); + + if (io_u->buflen == 0) + io_u->buflen = 1; + io_u->resid = 0; + return FIO_Q_COMPLETED; } diff --git a/examples/cpuio b/examples/cpuio new file mode 100644 index 00000000..577e0729 --- /dev/null +++ b/examples/cpuio @@ -0,0 +1,8 @@ +[global] +ioengine=cpuio +time_based +runtime=10 + +[burn50percent] +cpuload=50 +