]> err.no Git - linux-2.6/blobdiff - fs/aio.c
aio: only account I/O wait time in read_events if there are active requests
[linux-2.6] / fs / aio.c
index f12db415c0f6aa7b2776bdbcec1279a35c17da7f..9dec7d2d546e0e12e200898993f1b272111f5cee 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1161,7 +1161,12 @@ retry:
                        ret = 0;
                        if (to.timed_out)       /* Only check after read evt */
                                break;
-                       io_schedule();
+                       /* Try to only show up in io wait if there are ops
+                        *  in flight */
+                       if (ctx->reqs_active)
+                               io_schedule();
+                       else
+                               schedule();
                        if (signal_pending(tsk)) {
                                ret = -EINTR;
                                break;