public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, Hrvoje Zeba <[email protected]>,
	[email protected], "zhangyi (F)" <[email protected]>
Subject: Re: Odd timeout behavior
Date: Fri, 17 Apr 2020 11:39:33 +0300	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 12/04/2020 17:40, Jens Axboe wrote:
>> On 4/12/2020 5:07 AM, Jens Axboe wrote:
>>> Thinking about this, I think the mistake here is using the SQ side for
>>> the timeouts. Let's say you queue up N requests that are waiting, like
>>> the poll. Then you arm a timeout, it'll now be at N + count before it
>>> fires. We really should be using the CQ side for the timeouts.
...
> Reason I bring up the other part is that Hrvoje's test case had other
> cases as well, and the SQ vs CQ trigger is worth looking into. For
> example, if we do:
> 
> enqueue N polls
> enqueue timeout, count == 2, t = 10s
> enqueue 2 nops
> 
> I'd logically expect the timeout to trigger when nop #2 is completed.
> But it won't be, because we still have N polls waiting. What the count
> == 2 is really saying (right now) is "trigger timeout when CQ passes SQ
> by 2", which seems a bit odd.
> 

time for this:

1. do we really want to change current behaviour? As you said, there may be users.

2. why a timeout can't be triggered by another timeout completion? There are
bits adjusting req->sequence for enqueued timeouts up and down. I understand,
that liburing hides timeouts from users, but handling them inconsistently in
that sense from any other request is IMHO a bad idea. Can we kill it?

3. For your case, should it to fire exactly after those 2 nops? Or it can be
triggered by previously completed requests (e.g. polls)?

e.g. timeline as follows
- enqueue polls
- enqueue timeout
- 2 polls completed
- the timeout triggered by completion of polls
- do nops

The second one is what io_uring pdf says, and I'd prefer to have it.

-- 
Pavel Begunkov

  reply	other threads:[~2020-04-17  8:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-11 23:00 Odd timeout behavior Hrvoje Zeba
2020-04-12  2:07 ` Jens Axboe
2020-04-12  9:15   ` Pavel Begunkov
2020-04-12 14:40     ` Jens Axboe
2020-04-17  8:39       ` Pavel Begunkov [this message]
2020-04-17 14:37         ` Hrvoje Zeba
2020-04-12 15:14     ` Hrvoje Zeba
2020-04-13  8:21       ` Pavel Begunkov
2020-04-13 14:16         ` Jens Axboe
2020-04-13 19:09           ` Pavel Begunkov
2020-04-14  0:44             ` Jens Axboe
2020-04-14 15:46               ` Pavel Begunkov
2020-04-14 16:04                 ` Jens Axboe
2020-04-14 16:31                   ` 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 \
    [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