Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e00ba3dae077f54cfd2af42e939a618caa7a3bca
Commit:     e00ba3dae077f54cfd2af42e939a618caa7a3bca
Parent:     e3c0ac04f980750a368f7cd5f1b8d1d2cdc1f735
Author:     Jeff Moyer <[EMAIL PROTECTED]>
AuthorDate: Tue Dec 4 23:45:02 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Dec 5 09:21:18 2007 -0800

    aio: only account I/O wait time in read_events if there are active requests
    
    On 2.6.24, top started showing 100% iowait on one CPU when a UML instance 
was
    running (but completely idle).  The UML code sits in io_getevents waiting 
for
    an event to be submitted and completed.
    
    Fix this by checking ctx->reqs_active before scheduling to determine whether
    or not we are waiting for I/O.
    
    Signed-off-by: Jeff Moyer <[EMAIL PROTECTED]>
    Cc: Zach Brown <[EMAIL PROTECTED]>
    Cc: Miklos Szeredi <[EMAIL PROTECTED]>
    Cc: Jeff Dike <[EMAIL PROTECTED]>
    Cc: "Rafael J. Wysocki" <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/aio.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index f12db41..9dec7d2 100644
--- 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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to