aio: only account I/O wait time in read_events if there are active requests
commit47a1b6c7cb8b25471b52f5946025b427f277ee75
authorJeff Moyer <jmoyer@redhat.com>
Wed, 5 Dec 2007 07:45:02 +0000 (4 23:45 -0800)
committerOliver Pinter <oliver.pntr@gmail.com>
Thu, 1 May 2008 16:26:24 +0000 (1 18:26 +0200)
tree9f3da70cd480dcb7950e83121d3ee57e73737bbe
parente1a72131b3a5ea2d0c9111d4473ff3cf8f1747e1
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