4 * Doesn't transfer any data, merely burns CPU cycles according to
11 static int fio_cpuio_queue(struct thread_data *td, struct io_u fio_unused *io_u)
13 __usec_sleep(td->o.cpucycle);
14 return FIO_Q_COMPLETED;
17 static int fio_cpuio_setup(struct thread_data fio_unused *td)
22 for_each_file(td, f, i)
23 f->real_file_size = -1ULL;
28 static int fio_cpuio_init(struct thread_data *td)
30 struct thread_options *o = &td->o;
33 td_vmsg(td, EINVAL, "cpu thread needs rate (cpuload=)","cpuio");
41 * set thinktime_sleep and thinktime_spin appropriately
43 o->thinktime_blocks = 1;
44 o->thinktime_spin = 0;
45 o->thinktime = (o->cpucycle * (100 - o->cpuload)) / o->cpuload;
47 o->nr_files = o->open_files = 1;
51 static int fio_cpuio_open(struct thread_data fio_unused *td, struct fio_file *f)
57 static struct ioengine_ops ioengine = {
59 .version = FIO_IOOPS_VERSION,
60 .queue = fio_cpuio_queue,
61 .init = fio_cpuio_init,
62 .setup = fio_cpuio_setup,
63 .open_file = fio_cpuio_open,
64 .flags = FIO_SYNCIO | FIO_DISKLESSIO,
67 static void fio_init fio_cpuio_register(void)
69 register_ioengine(&ioengine);
72 static void fio_exit fio_cpuio_unregister(void)
74 unregister_ioengine(&ioengine);