Re: linux io_submit syscall duration

Jens Axboe
2006-11-15T09:48:07Z

(don't top post and don't drop the cc list!)

On Wed, Nov 15 2006, Raz Ben-Jehuda(caro) wrote:
> first thank you from your quick reply.
>
> I looked and what I found is :
> "io_submit() taking a long time to return ?" from 2006-07-14.

Subject is "async I/O seems to be blocking on 2.6.15" and the posting is
from 2006-11-3. I said about a week ago, not 4 months.

> 1. It is NOT the first IO. already took care for that in my test.

That was a different problem.

> 2. The test uses block device and does not walk through a file system.

So would not apply.

> 3. Taking a look at the code, it seems that the main problem is the fact
> that in io_submit_one all the pending requests are being rerun.
>
> io_submit_one()
> {
> ...
> if (!list_empty(&ctx->run_list)) {
> /* drain the run list */
> while (__aio_run_iocbs(ctx))
> ;
> }
> ...
> }
>
> This code was put in remarks.
> the second is in:
> aio_run_iocb()
> ...
> current->io_wait = &iocb->ki_wait;
> if ( iocb->ki_retried > 1)
> ret = retry(iocb);
> else{
> ret = -EIOCBRETRY;
> kiocbSetKicked(iocb);
> }
> current->io_wait = NULL;
> ....
>
> With these fixes io_submit delay reduced to zero ms.
>
> I would appreciate your review on these fixes.

Post a patch so it can be reviewed.

--
Jens Axboe