From: Radha Ramachandran Date: Thu, 5 Nov 2009 07:33:49 +0000 (+0100) Subject: Don't pass more than the queued IO depth in to getevents() X-Git-Tag: fio-1.35~1 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=6a96276c901992b21c3ad93f95ab0a081c7d6bb1;ds=sidebyside Don't pass more than the queued IO depth in to getevents() Otherwise we can hang fio, since it'll attempt to wait for more IOs than we have in flight. Signed-off-by: Jens Axboe --- diff --git a/fio.c b/fio.c index debcac5e..434b5037 100644 --- a/fio.c +++ b/fio.c @@ -536,7 +536,8 @@ sync_done: */ full = queue_full(td) || ret == FIO_Q_BUSY; if (full || !td->o.iodepth_batch_complete) { - min_events = td->o.iodepth_batch_complete; + min_events = min(td->o.iodepth_batch_complete, + td->cur_depth); if (full && !min_events) min_events = 1; @@ -688,7 +689,8 @@ sync_done: */ full = queue_full(td) || ret == FIO_Q_BUSY; if (full || !td->o.iodepth_batch_complete) { - min_evts = td->o.iodepth_batch_complete; + min_evts = min(td->o.iodepth_batch_complete, + td->cur_depth); if (full && !min_evts) min_evts = 1;