Fix busy looping for io_u_queued_complete()
authorJens Axboe <jens.axboe@oracle.com>
Mon, 19 Feb 2007 15:00:42 +0000 (16:00 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 19 Feb 2007 15:00:42 +0000 (16:00 +0100)
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 <jens.axboe@oracle.com>
io_u.c

diff --git a/io_u.c b/io_u.c
index 645cba40b4f012096bafff178b697ecff0ec46aa..7e5bfcc190585362a075d47b1134fbb049d5f1d2 100644 (file)
--- 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;