public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Bijan Mottahedeh <[email protected]>
Cc: [email protected]
Subject: Re: [RFC 1/1] io_uring: process requests completed with -EAGAIN on poll list
Date: Fri, 3 Apr 2020 13:38:26 -0600	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 4/2/20 12:54 PM, Bijan Mottahedeh wrote:
> A request that completes with an -EAGAIN result after it has been added
> to the poll list, will not be removed from that list in io_do_iopoll()
> because the f_op->iopoll() will not succeed for that request.
> 
> Maintain a retryable local list similar to the done list, and explicity
> reissue requests with an -EAGAIN result.

I think this looks reasonable. You could make the loop here:

> +static void io_iopoll_queue(struct list_head *again)
> +{
> +	struct io_kiocb *req;
> +
> +	while (!list_empty(again)) {
> +		req = list_first_entry(again, struct io_kiocb, list);
> +		list_del(&req->list);
> +		refcount_inc(&req->refs);
> +		io_queue_async_work(req);
> +	}
> +}

be:
	do {
		req = list_first_entry(again, struct io_kiocb, list);
		list_del(&req->list);
		refcount_inc(&req->refs);
		io_queue_async_work(req);
	} while (!list_empty(again));

as you always enter with it non-empty, at least that eliminates one
check per list.

We could also issue inline again, instead of punting these async. But
probably not worth the bother.

-- 
Jens Axboe


      reply	other threads:[~2020-04-03 19:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02 18:54 [RFC 0/1] io_uring: process requests completed with -EAGAIN on poll list Bijan Mottahedeh
2020-04-02 18:54 ` [RFC 1/1] " Bijan Mottahedeh
2020-04-03 19:38   ` Jens Axboe [this message]

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox