[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-aio
Subject:    Re: [PATCH 04/32] aio: remove retry-based AIO
From:       Hillf Danton <dhillf () gmail ! com>
Date:       2012-12-29 7:47:37
Message-ID: CAJd=RBCHJSkA0UChN+41HknLgi=NOM32jq3L9+Rse_a66FrP4g () mail ! gmail ! com
[Download RAW message or body]

On Thu, Dec 27, 2012 at 9:59 AM, Kent Overstreet <koverstreet@google.com> wrote:
> @@ -1585,18 +1278,27 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
>          * don't see ctx->dead set here, io_destroy() waits for our IO to
>          * finish.
>          */
> -       if (ctx->dead) {
> -               spin_unlock_irq(&ctx->ctx_lock);
> +       if (ctx->dead)
>                 ret = -EINVAL;
> +       spin_unlock_irq(&ctx->ctx_lock);
> +       if (ret)
>                 goto out_put_req;
> +
> +       if (unlikely(kiocbIsCancelled(req))) {
> +               ret = -EINTR;
> +       } else {
> +               ret = req->ki_retry(req);
>         }
> -       aio_run_iocb(req);
> -       if (!list_empty(&ctx->run_list)) {
> -               /* drain the run list */
> -               while (__aio_run_iocbs(ctx))
> -                       ;
> +       if (ret != -EIOCBQUEUED) {
> +               /*
> +                * There's no easy way to restart the syscall since other AIO's
> +                * may be already running. Just fail this IO with EINTR.
> +                */
> +               if (unlikely(ret == -ERESTARTSYS || ret == -ERESTARTNOINTR ||
> +                            ret == -ERESTARTNOHAND || ret == -ERESTART_RESTARTBLOCK))
> +                       ret = -EINTR;
> +               aio_complete(req, ret, 0);
>         }
> -       spin_unlock_irq(&ctx->ctx_lock);
>
>         aio_put_req(req);       /* drop extra ref to req */
>         return 0;

          return ret;          yes?

--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org.  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic