public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Pavel Begunkov <[email protected]>, [email protected]
Subject: Re: [PATCH 1/1] io_uring: replace inflight_wait with tctx->wait
Date: Mon, 16 Nov 2020 09:33:15 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <ce4f91e603b524b6425d68cf49c83c7d4fbd7d79.1605444955.git.asml.silence@gmail.com>

On 11/15/20 5:56 AM, Pavel Begunkov wrote:
> As tasks now cancel only theirs requests, and inflight_wait is awaited
> only in io_uring_cancel_files(), which should be called with ->in_idle
> set, instead of keeping a separate inflight_wait use tctx->wait.
> 
> That will add some spurious wakeups but actually is safer from point of
> not hanging the task.
> 
> e.g.
> task1                   | IRQ
>                         | *start* io_complete_rw_common(link)
>                         |        link: req1 -> req2 -> req3(with files)
> *cancel_files()         |
> io_wq_cancel(), etc.    |
>                         | put_req(link), adds to io-wq req2
> schedule()              |
> 
> So, task1 will never try to cancel req2 or req3. If req2 is
> long-standing (e.g. read(empty_pipe)), this may hang.

This looks like it's against 5.11, but also looks like we should add
it for 5.10?

-- 
Jens Axboe


  reply	other threads:[~2020-11-16 16:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-15 12:56 [PATCH 1/1] io_uring: replace inflight_wait with tctx->wait Pavel Begunkov
2020-11-16 16:33 ` Jens Axboe [this message]
2020-11-16 16:48   ` Pavel Begunkov
2020-11-16 16:57     ` Jens Axboe
2020-11-16 17:16       ` Pavel Begunkov
2020-11-16 20:42         ` 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] \
    /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