aio: only account I/O wait time in read_events if there are active requests
commitfa641adb014dea46e1758ceb0e068d8d90927df3
authorJeff Moyer <jmoyer@redhat.com>
Wed, 5 Dec 2007 07:45:02 +0000 (4 23:45 -0800)
committerOliver Pinter <oliver.pntr@gmail.com>
Wed, 7 May 2008 14:02:28 +0000 (7 16:02 +0200)
tree9f3da70cd480dcb7950e83121d3ee57e73737bbe
parent9d1fb599033713e8804c84c51005bacbb561ce4b
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 <jmoyer@redhat.com>
Cc: Zach Brown <zach.brown@oracle.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>
fs/aio.c