options: Add thinktime_iotime option
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Mon, 6 Sep 2021 01:50:00 +0000 (10:50 +0900)
committerJens Axboe <axboe@kernel.dk>
Mon, 6 Sep 2021 03:11:25 +0000 (21:11 -0600)
commitf7942acdc23a4ee837ef30834e1d2cb1fc6d0afe
tree1f28848bc04e7849d35c7e50abd47508e46e5f1f
parent63176c21beb68ec54787eb2fd6be5b3c9132113b
options: Add thinktime_iotime option

The thinktime option allows stalling a job for a specified amount of
time. Using the thinktime_blocks option, periodic stalls can be added
every thinktime_blocks IOs. However, with this option, the periodic
stall may not be repeated at equal time intervals as the time to execute
thinktime_blocks IOs may vary.

To control the thinktime interval by time, introduce the option
thinktime_iotime. With this new option, the thinktime stall is repeated
after IOs are executed for thinktime_iotime. If this option is used
together with the thinktime_blocks option, the thinktime pause is
repeated after thinktime_iotime or after thinktime_blocks IOs, whichever
happens first.

To support the new option, add a new member thinktime_iotime in the
struct thread_options and the struct thread_options_pack. Avoid size
increase of the struct thread_options_pack by replacing a padding 'pad5'
with the new member. To keep thinktime related members close, move the
members near the position where the padding was placed. Make same
changes to the struct thread_option also for consistency.

To track the time and IO block count at the last stall, add
last_thinktime variable and last_thinktime_blocks variable to struct
thread_data. Also, introduce the helper function init_thinktime()
to group thinktime related preparations.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
HOWTO
backend.c
cconv.c
fio.1
fio.h
options.c
server.h
thread_options.h