Commit 41d10da3717409de33d5441f2f6d8f072ab3fbb6

Authored by Jeff Moyer
Committed by Linus Torvalds
1 parent c17ac85504

aio: account I/O wait time properly

Some months back I proposed changing the schedule() call in
read_events to an io_schedule():
	http://osdir.com/ml/linux.kernel.aio.general/2006-10/msg00024.html
This was rejected as there are AIO operations that do not initiate
disk I/O.  I've had another look at the problem, and the only AIO
operation that will not initiate disk I/O is IOCB_CMD_NOOP.  However,
this command isn't even wired up!

Given that it doesn't work, and hasn't for *years*, I'm going to
suggest again that we do proper I/O accounting when using AIO.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Acked-by: Zach Brown <zach.brown@oracle.com>
Cc: Benjamin LaHaise <bcrl@kvack.org>
Cc: Suparna Bhattacharya <suparna@in.ibm.com>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff

... ... @@ -303,7 +303,7 @@
303 303 set_task_state(tsk, TASK_UNINTERRUPTIBLE);
304 304 while (ctx->reqs_active) {
305 305 spin_unlock_irq(&ctx->ctx_lock);
306   - schedule();
  306 + io_schedule();
307 307 set_task_state(tsk, TASK_UNINTERRUPTIBLE);
308 308 spin_lock_irq(&ctx->ctx_lock);
309 309 }
... ... @@ -323,7 +323,7 @@
323 323 set_current_state(TASK_UNINTERRUPTIBLE);
324 324 if (!iocb->ki_users)
325 325 break;
326   - schedule();
  326 + io_schedule();
327 327 }
328 328 __set_current_state(TASK_RUNNING);
329 329 return iocb->ki_user_data;
... ... @@ -1170,7 +1170,7 @@
1170 1170 ret = 0;
1171 1171 if (to.timed_out) /* Only check after read evt */
1172 1172 break;
1173   - schedule();
  1173 + io_schedule();
1174 1174 if (signal_pending(tsk)) {
1175 1175 ret = -EINTR;
1176 1176 break;