4 * Doesn't transfer any data, merely burns CPU cycles according to
10 static int fio_cpuio_queue(struct thread_data *td, struct io_u fio_unused *io_u)
12 __usec_sleep(td->o.cpucycle);
13 return FIO_Q_COMPLETED;
16 static int fio_cpuio_init(struct thread_data *td)
18 struct thread_options *o = &td->o;
21 td_vmsg(td, EINVAL, "cpu thread needs rate (cpuload=)","cpuio");
29 * set thinktime_sleep and thinktime_spin appropriately
31 o->thinktime_blocks = 1;
32 o->thinktime_spin = 0;
33 o->thinktime = (o->cpucycle * (100 - o->cpuload)) / o->cpuload;
35 o->nr_files = o->open_files = 1;
39 static int fio_cpuio_open(struct thread_data fio_unused *td,
40 struct fio_file fio_unused *f)
45 static struct ioengine_ops ioengine = {
47 .version = FIO_IOOPS_VERSION,
48 .queue = fio_cpuio_queue,
49 .init = fio_cpuio_init,
50 .open_file = fio_cpuio_open,
51 .flags = FIO_SYNCIO | FIO_DISKLESSIO,
54 static void fio_init fio_cpuio_register(void)
56 register_ioengine(&ioengine);
59 static void fio_exit fio_cpuio_unregister(void)
61 unregister_ioengine(&ioengine);