All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, io-uring <io-uring@vger.kernel.org>
Subject: Re: [PATCH] io_uring: pick up link work on submit reference drop
Date: Wed, 26 Feb 2020 00:22:13 +0300	[thread overview]
Message-ID: <82423419-1c14-418e-8085-2d8b902b0a2d@gmail.com> (raw)
In-Reply-To: <1c5f074e-22dd-095a-6be7-730c81eeb1b1@kernel.dk>

On 25/02/2020 23:27, Jens Axboe wrote:
> If work completes inline, then we should pick up a dependent link item
> in __io_queue_sqe() as well. If we don't do so, we're forced to go async
> with that item, which is suboptimal.
> 
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> 
> ---
> 
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index ffd9bfa84d86..160cf1b0f478 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -4531,8 +4531,15 @@ static void io_wq_submit_work(struct io_wq_work **workptr)
>  		} while (1);
>  	}
>  
> -	/* drop submission reference */
> -	io_put_req(req);
> +	/*
> +	 * Drop submission reference. In case the handler already dropped the
> +	 * completion reference, then it didn't pick up any potential link
> +	 * work. If 'nxt' isn't set, try and do that here.
> +	 */
> +	if (nxt)

It can't even get here, because of the submission ref, isn't it? would the
following do?

-	io_put_req(req);
+	io_put_req_find_next(req, &nxt);

BTW, as I mentioned before, it appears to me, we don't even need completion ref
as it always pinned by the submission ref. I'll resurrect the patches doing
that, but after your poll work will land.


> +		io_put_req(req);
> +	else
> +		io_put_req_find_next(req, &nxt);
>  
>  	if (ret) {
>  		req_set_fail_links(req);
> 

-- 
Pavel Begunkov

  reply	other threads:[~2020-02-25 21:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25 20:27 [PATCH] io_uring: pick up link work on submit reference drop Jens Axboe
2020-02-25 21:22 ` Pavel Begunkov [this message]
2020-02-25 21:25   ` Jens Axboe
2020-02-25 21:41     ` Jens Axboe
2020-02-25 22:18       ` Jens Axboe
2020-02-26  8:33         ` Pavel Begunkov
2020-02-26  9:46           ` Pavel Begunkov
2020-02-26 14:04           ` Jens Axboe
2020-02-25 21:45     ` Pavel Begunkov
2020-02-25 21:52       ` Pavel Begunkov
2020-02-25 22:24         ` Jens Axboe
2020-02-26  6:32           ` Pavel Begunkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=82423419-1c14-418e-8085-2d8b902b0a2d@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.