From: Jens Axboe <axboe@kernel.dk>
To: Keith Busch <kbusch@kernel.org>
Cc: Keith Busch <kbusch@meta.com>,
io-uring@vger.kernel.org, superman.xpt@gmail.com
Subject: Re: [PATCH] io_uring: consistently use rcu semantics with sqpoll thread
Date: Tue, 10 Jun 2025 14:45:03 -0600 [thread overview]
Message-ID: <f0e4a1f5-0571-4a69-afef-e8c845f19f47@kernel.dk> (raw)
In-Reply-To: <aEiToYXiUneeNFq_@kbusch-mbp>
On 6/10/25 2:20 PM, Keith Busch wrote:
> On Tue, Jun 10, 2025 at 02:04:41PM -0600, Jens Axboe wrote:
>> On 6/10/25 1:30 PM, Keith Busch wrote:
>>> From: Keith Busch <kbusch@kernel.org>
>>>
>>> It is already dereferenced with rcu read protection, so it needs to be
>>> annotated as such, and consistently use rcu helpers for access and
>>> assignment.
>>
>> There are some bits in io_uring.c that access it, which probably need
>> some attention too I think. One of them a bit trickier.
>
> Oh, sure is. I just ran 'make C=1' on the originally affected files, but
> should have ran it on all of io_uring/.
>
> I think the below should clear up the new warnings. I think it's safe to
> hold the rcu read lock for the tricky one as io_wq_cancel_cb() doesn't
> appear to make any blocking calls.
It _probably_ is, but that's entirely untested. Right now it looks fine,
for a variety of reasons like submitting work that's marked cancel
should not be doing anything with it really. But it doesn't feel me with
joy, particularly as only the somewhat uncommon SQPOLL is the one that
will do it.
The io_sq_thread_park() parts in the patch also look broken, as an
rcu_access_pointer() is being passed into wake_up_process(). It should
all be fine, but it's now a case of instrumentation actively making the
code more confusing to read.
I think we might be better off leaving the sparse warnings and doing a
proper io_sq_data accessor thing for this, rather than try and paper
over the sparse warnings.
--
Jens Axboe
next prev parent reply other threads:[~2025-06-10 20:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-10 19:30 [PATCH] io_uring: consistently use rcu semantics with sqpoll thread Keith Busch
2025-06-10 20:04 ` Jens Axboe
2025-06-10 20:20 ` Keith Busch
2025-06-10 20:45 ` Jens Axboe [this message]
2025-06-10 20:52 ` Jens Axboe
2025-06-10 21:04 ` Keith Busch
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=f0e4a1f5-0571-4a69-afef-e8c845f19f47@kernel.dk \
--to=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=kbusch@kernel.org \
--cc=kbusch@meta.com \
--cc=superman.xpt@gmail.com \
/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