From: Jens Axboe Date: Mon, 19 Feb 2007 15:00:42 +0000 (+0100) Subject: Fix busy looping for io_u_queued_complete() X-Git-Tag: fio-1.12~63 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=afab5e46cf0a984a87426329b3157e38d9a419a4;p=fio.git Fix busy looping for io_u_queued_complete() If min_events > 0, don't set a 0 timeout or we'll end up busy looping in the io engine getevents handler. Just disable the timeout for now, perhaps we'll reuse it in the future to prevent a thread from stalling too long there. Signed-off-by: Jens Axboe --- diff --git a/io_u.c b/io_u.c index 645cba40..7e5bfcc1 100644 --- a/io_u.c +++ b/io_u.c @@ -524,13 +524,10 @@ long io_u_queued_complete(struct thread_data *td, int min_events, endio_handler *handler) { - struct timespec ts = { .tv_sec = 0, .tv_nsec = 0, }; - struct timespec *tsp = NULL; struct io_completion_data icd; int ret; if (min_events > 0) { - tsp = &ts; ret = td_io_commit(td); if (ret < 0) { td_verror(td, -ret); @@ -538,7 +535,7 @@ long io_u_queued_complete(struct thread_data *td, int min_events, } } - ret = td_io_getevents(td, min_events, td->cur_depth, tsp); + ret = td_io_getevents(td, min_events, td->cur_depth, NULL); if (ret < 0) { td_verror(td, -ret); return ret;