Fix issues (assert or uninit var, hang) with check_min_rate and offloading
authoraggieNick02 <nick@pcpartpicker.com>
Fri, 11 Feb 2022 20:46:12 +0000 (14:46 -0600)
committeraggieNick02 <nick@pcpartpicker.com>
Fri, 11 Feb 2022 20:46:12 +0000 (14:46 -0600)
commit5b28b75b8cca843d616d2d54a77fdb5797c00f54
tree080b6d06b5d0cfff9d4dd1be087cf84731cf02e7
parentf57a3a31c8d074b309f797a4336101e4c1e5ed39
Fix issues (assert or uninit var, hang) with check_min_rate and offloading

Using rate_min/rate_iops_min when io_submit_mode=offload option is set
leads to intermittent asserts and doesn't work. The variable comp_time
is never set in do_io in backend.c in the offload case, and comp_time is
then used in the calls to check_min_rate. The time computations in
check_min_rate either assert and terminate fio, or return meaningless
values, so any rate checking is not correct.

This first issue is fixed by adding a call to fio_gettime in the
offloading case. Once that is done though, there is still another
problem remaining. When the min rate is not achieved (with the
offloading option), fio detects it and tries to exit but fails. It ends
up in a state where ctrl-C will not cause an exit either. This happens
because cleanup_pending_aio(td) in the error case hangs in its second
call to io_u_queued_complete. Calling workqueue_flush in the error case
(when offloading) fixes the problem by making sure nothing is left in
the work queues and cleanup can proceed as it does in the non-offload
case.

Signed-off-by: Nick Neumann <nick@pcpartpicker.com>
backend.c