X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Faio.c;h=8a37dbbf3437cb78021c22c608dc8beb4cbe2788;hb=2d3a4e3666325a9709cc8ea2e88151394e8f20fc;hp=f12db415c0f6aa7b2776bdbcec1279a35c17da7f;hpb=70180659a479b55387eca8cc1fa7024ba8410b14;p=linux-2.6 diff --git a/fs/aio.c b/fs/aio.c index f12db415c0..8a37dbbf34 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -397,7 +397,7 @@ void fastcall __put_ioctx(struct kioctx *ctx) * This prevents races between the aio code path referencing the * req (after submitting it) and aio_complete() freeing the req. */ -static struct kiocb *FASTCALL(__aio_get_req(struct kioctx *ctx)); +static struct kiocb *__aio_get_req(struct kioctx *ctx); static struct kiocb fastcall *__aio_get_req(struct kioctx *ctx) { struct kiocb *req = NULL; @@ -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;