public inbox for [email protected]
 help / color / mirror / Atom feed
From: Hrvoje Zeba <[email protected]>
To: Pavel Begunkov <[email protected]>
Cc: Jens Axboe <[email protected]>,
	[email protected], "zhangyi (F)" <[email protected]>
Subject: Re: Odd timeout behavior
Date: Fri, 17 Apr 2020 10:37:45 -0400	[thread overview]
Message-ID: <CAEsUgYiVhHo7W3abX6xgPBcja8qS5inCBwGUtjRtqDozUbu7Pg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>

On Fri, Apr 17, 2020 at 4:40 AM Pavel Begunkov <[email protected]> wrote:
>
> 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.
>

I still see io_uring as early development. I've had several breakages
when I upgraded the kernel so far. I'm fine with it.

> 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
>

Timeout fires on any cqes is the behavior I expected. I can see the
reasoning behind only triggering for sqes that come after the timeout
(io_uring_submit_and_wait() being the use-case) tho.

-- 
I doubt, therefore I might be.

  reply	other threads:[~2020-04-17 14:37 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
2020-04-17 14:37         ` Hrvoje Zeba [this message]
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 \
    --in-reply-to=CAEsUgYiVhHo7W3abX6xgPBcja8qS5inCBwGUtjRtqDozUbu7Pg@mail.gmail.com \
    [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