From afab5e46cf0a984a87426329b3157e38d9a419a4 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 19 Feb 2007 16:00:42 +0100 Subject: [PATCH] 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 --- io_u.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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; -- 2.25.1