All of lore.kernel.org
 help / color / mirror / Atom feed
* Problems with check_min_rate and io_submit_mode=offload ?
@ 2022-02-09 21:40 Nick Neumann
  0 siblings, 0 replies; only message in thread
From: Nick Neumann @ 2022-02-09 21:40 UTC (permalink / raw)
  To: fio

I started trying to use the rate_min and rate_iops_min options. I was
trying to use them with io_submit_mode=offload. There appear to be
some significant issues with it though.

The first is that it will intermittently assert and generally ignore
any minimum specified rate. Why? Because in do_io in backend.c, in the
IO_OFFLOAD case, comp_time is never set. This means that later when
check_min_rate is passed comp_time, it is checking using a time for
"now" that is an uninitialized variable. Sometimes that will trip the
assert in rel_time_since, sometimes not. And when not, any rate
checking is not going to be right.

So I added a call to fio_gettime in the IO_OFFLOAD case under the
if(should_check_rate(td)...)

Now the job will catch when rate_min is not met, but something goes
wrong in the shutdown. Fio ends up in a state where IO appears to
stop, but fio doesn't exit, and ctrl-C will not cause an exit either.
This is because td->error is (rightly) set, so the code after the main
loop in do_io will enter the "else cleanup_pending_aio(td)" and hang
in its second call to io_u_queued_complete.

I think the right fix is to call workqueue_flush before
cleanup_pending_aio (in the error, offload case), so that there is
nothing left in the work queues and cleanup can proceed as it does in
the non-offload case.

Two questions before I submit a PR for this:
1) Does adding the fio_gettime() call in the offload case seem right?
2) Does adding the workqueue_flush in the error case before cleanup seem right?

Thanks,
Nick

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-09 21:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-09 21:40 Problems with check_min_rate and io_submit_mode=offload ? Nick Neumann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.