public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: io-uring <[email protected]>
Subject: Re: [PATCH] io_uring: fix readiness race with poll based retry
Date: Thu, 28 May 2020 20:25:52 -0600	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 5/28/20 7:51 PM, Jens Axboe wrote:
> The poll based retry handler uses the same logic as the normal poll
> requests, but the latter triggers a completion if we hit the slim
> race of:
> 
> 1a) data/space isn't available
> 2a) data/space becomes available
> 1b) arm poll handler (returns success, callback not armed)
> 
> This isn't the case for the task_work based retry, where we need to
> take action if the event triggered in the short time between trying
> and arming the poll handler.
> 
> Catch this case in __io_arm_poll_handler(), and queue the task_work
> upfront instead of depending on the waitq handler triggering it. The
> latter isn't armed at this point.

Disregard this one, I don't think this race exists. If we hit the
poll->head != NULL case, then we definitely added the waitq. And if
the list is empty once we're under the lock, we already triggered
the callback and queued the task_work.

-- 
Jens Axboe


      reply	other threads:[~2020-05-29  2:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29  1:51 [PATCH] io_uring: fix readiness race with poll based retry Jens Axboe
2020-05-29  2:25 ` Jens Axboe [this message]

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