public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Hao Xu <[email protected]>
Cc: [email protected], Pavel Begunkov <[email protected]>,
	Joseph Qi <[email protected]>
Subject: Re: [PATCH v3] io_uring: maintain drain logic for multishot poll requests
Date: Tue, 27 Apr 2021 07:40:11 -0600	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 4/13/21 1:20 AM, Hao Xu wrote:
> Now that we have multishot poll requests, one SQE can emit multiple
> CQEs. given below example:
>     sqe0(multishot poll)-->sqe1-->sqe2(drain req)
> sqe2 is designed to issue after sqe0 and sqe1 completed, but since sqe0
> is a multishot poll request, sqe2 may be issued after sqe0's event
> triggered twice before sqe1 completed. This isn't what users leverage
> drain requests for.
> Here the solution is to wait for multishot poll requests fully
> completed.
> To achieve this, we should reconsider the req_need_defer equation, the
> original one is:
> 
>     all_sqes(excluding dropped ones) == all_cqes(including dropped ones)
> 
> This means we issue a drain request when all the previous submitted
> SQEs have generated their CQEs.
> Now we should consider multishot requests, we deduct all the multishot
> CQEs except the cancellation one, In this way a multishot poll request
> behave like a normal request, so:
>     all_sqes == all_cqes - multishot_cqes(except cancellations)
> 
> Here we introduce cq_extra for it.

Thanks, applied this and the test case.

-- 
Jens Axboe


      parent reply	other threads:[~2021-04-27 13:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13  7:20 [PATCH v3] io_uring: maintain drain logic for multishot poll requests Hao Xu
2021-04-13  7:23 ` [PATCH v2] add tests for drain io with multishot reqs Hao Xu
2021-04-14 10:48   ` Pavel Begunkov
2021-04-27  6:48     ` Hao Xu
2021-04-27 13:40 ` 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] \
    [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