From: Daniel Byrne <daniel1.byrne@intel.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: Daniel Byrne <daniel1.byrne@intel.com>,
Pavel Begunkov <asml.silence@gmail.com>,
io-uring@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Josef Bacik <josef@toxicpanda.com>
Subject: Re: [PATCH] io_uring: don't sleep on a claimed DEFER_TASKRUN wakeup
Date: Wed, 28 Oct 2026 06:30:40 -0700 [thread overview]
Message-ID: <20261028133040.1833849-1-daniel1.byrne@intel.com> (raw)
In-Reply-To: <23ea58c1-0692-4f11-80d1-8845971902be@kernel.dk>
On Mon, 19 Oct 2026 13:05:07 -0600, Jens Axboe wrote:
> This should already be fixed by proper ordering in my
> for-7.4/io_uring branch - see:
>
> 8257f6ec45ee ("io_uring: don't lose the DEFER_TASKRUN wake up")
>
> and
>
> 76a82c666abf ("io_uring/cancel: rearm local work wake up before sleep")
>
> Please take a look and see if you agree.
Yes, those two fix it. Setting the state before the count is
published removes the window my patch detected, and the re-arm after
prepare_to_wait() closes the cancel path the same way.
My prototype that found this polls DMA device completions in
TASK_RUNNING between the arm and the sleep. I added a test udelay(100)
in every 64th io_req_local_work_add() between the mpscq push and
the cq_wait_nr claim. As a result, we hit the race on v7.3.
On for-7.4/io_uring, re-arming through io_cq_wait_arm() after its poll,
we ran race free.
Thanks,
Daniel
prev parent reply other threads:[~2026-10-28 13:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 15:06 Daniel Byrne
2026-10-19 19:05 ` Jens Axboe
2026-10-28 13:30 ` Daniel Byrne [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 \
--in-reply-to=20261028133040.1833849-1-daniel1.byrne@intel.com \
--to=daniel1.byrne@intel.com \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=josef@toxicpanda.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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
all inboxes | Powered by JetHome®