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_setup(struct thread_data fio_unused *td)
21 for_each_file(td, f, i)
22 f->real_file_size = -1ULL;
27 static int fio_cpuio_init(struct thread_data *td)
29 struct thread_options *o = &td->o;
32 td_vmsg(td, EINVAL, "cpu thread needs rate (cpuload=)","cpuio");
40 * set thinktime_sleep and thinktime_spin appropriately
42 o->thinktime_blocks = 1;
43 o->thinktime_spin = 0;
44 o->thinktime = (o->cpucycle * (100 - o->cpuload)) / o->cpuload;
46 o->nr_files = o->open_files = 1;
50 static int fio_cpuio_open(struct thread_data fio_unused *td, struct fio_file *f)
56 static struct ioengine_ops ioengine = {
58 .version = FIO_IOOPS_VERSION,
59 .queue = fio_cpuio_queue,
60 .init = fio_cpuio_init,
61 .setup = fio_cpuio_setup,
62 .open_file = fio_cpuio_open,
63 .flags = FIO_SYNCIO | FIO_DISKLESSIO,
66 static void fio_init fio_cpuio_register(void)
68 register_ioengine(&ioengine);
71 static void fio_exit fio_cpuio_unregister(void)
73 unregister_ioengine(&ioengine);