提交 e00ba3da 编写于 作者: J Jeff Moyer 提交者: Linus Torvalds

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: NJeff 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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 e3c0ac04
...@@ -1161,7 +1161,12 @@ static int read_events(struct kioctx *ctx, ...@@ -1161,7 +1161,12 @@ static int read_events(struct kioctx *ctx,
ret = 0; ret = 0;
if (to.timed_out) /* Only check after read evt */ if (to.timed_out) /* Only check after read evt */
break; 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)) { if (signal_pending(tsk)) {
ret = -EINTR; ret = -EINTR;
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册