public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Pavel Begunkov <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: [PATCH 1/1] io_uring: don't wait when under-submitting
Date: Fri, 13 Dec 2019 14:48:28 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>


> On Dec 13, 2019, at 2:32 PM, Pavel Begunkov <[email protected]> wrote:
> 
> On 13/12/2019 21:32, Jens Axboe wrote:
>>> On 12/13/19 11:22 AM, Jens Axboe wrote:
>>> On 12/13/19 12:51 AM, Pavel Begunkov wrote:
>>>> There is no reliable way to submit and wait in a single syscall, as
>>>> io_submit_sqes() may under-consume sqes (in case of an early error).
>>>> Then it will wait for not-yet-submitted requests, deadlocking the user
>>>> in most cases.
>>> 
>>> Why not just cap the wait_nr? If someone does to_submit = 8, wait_nr = 8,
>>> and we only submit 4, just wait for 4? Ala:
>>> 
> 
> Is it worth entangling the code? I don't expect anyone trying to recover,
> maybe except full reset/restart. So, failing ASAP seemed to me as the
> right thing to do. It may also mean nothing to the user if e.g.
> submit(1), submit(1), ..., submit_and_wait(1, n)
> 
> Anyway, this shouldn't even happen in a not buggy code, so I'm fine with
> any version as long as it doesn't lock up. I'll resend if you still prefer
> to cap it.

I like the cap version a lot better, and in fact we did used to have that but lost it early. I like it behaviorally a lot better, too. 

Can you resend? Thanks!


  reply	other threads:[~2019-12-13 21:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-13  7:51 [PATCH 1/1] io_uring: don't wait when under-submitting Pavel Begunkov
2019-12-13 18:22 ` Jens Axboe
2019-12-13 18:32   ` Jens Axboe
2019-12-13 21:32     ` Pavel Begunkov
2019-12-13 21:48       ` Jens Axboe [this message]
2019-12-14 14:31 ` [PATCH v2] " Pavel Begunkov
2019-12-14 14:39   ` Jens Axboe
2019-12-14 14:44     ` Pavel Begunkov
2019-12-14 14:53   ` [PATCH v3] " Pavel Begunkov
2019-12-14 18:43     ` Jens Axboe
2019-12-15  5:42       ` Jens Axboe
2019-12-15 15:48         ` Pavel Begunkov
2019-12-15 21:33           ` Jens Axboe
2019-12-16 16:31             ` [PATCH v4] " Pavel Begunkov
2019-12-16 16:47             ` [PATCH v3] " Pavel Begunkov
2019-12-16 16:51               ` Jens Axboe

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] \
    /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