public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: [email protected], [email protected]
Subject: Re: Canceled read requests never completed
Date: Tue, 18 Jan 2022 19:32:34 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 1/18/22 4:36 PM, Jens Axboe wrote:
> On 1/18/22 1:05 PM, Florian Fischer wrote:
>>>> After reading the io_uring_enter(2) man page a IORING_OP_ASYNC_CANCEL's return value of -EALREADY apparently
>>>> may not cause the request to terminate. At least that is our interpretation of "…res field will contain -EALREADY.
>>>> In this case, the request may or may not terminate."
>>>
>>> I took a look at this, and my theory is that the request cancelation
>>> ends up happening right in between when the work item is moved between
>>> the work list and to the worker itself. The way the async queue works,
>>> the work item is sitting in a list until it gets assigned by a worker.
>>> When that assignment happens, it's removed from the general work list
>>> and then assigned to the worker itself. There's a small gap there where
>>> the work cannot be found in the general list, and isn't yet findable in
>>> the worker itself either.
>>>
>>> Do you always see -ENOENT from the cancel when you get the hang
>>> condition?
>>
>> No we also and actually more commonly observe cancel returning
>> -EALREADY and the canceled read request never gets completed.
>>
>> As shown in the log snippet I included below.
> 
> I think there are a couple of different cases here. Can you try the
> below patch? It's against current -git.

Cleaned it up and split it into functional bits, end result is here:

https://git.kernel.dk/cgit/linux-block/log/?h=io_uring-5.17

-- 
Jens Axboe


  reply	other threads:[~2022-01-19  2:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-18 15:13 Canceled read requests never completed Florian Fischer
2022-01-18 19:07 ` Jens Axboe
2022-01-18 20:05   ` Florian Fischer
2022-01-18 23:36     ` Jens Axboe
2022-01-19  2:32       ` Jens Axboe [this message]
2022-01-19 13:42         ` Florian Fischer

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