From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: [email protected], Kees Bakker <[email protected]>
Subject: [PATCH 1/1] io_uring/zcrx: recheck ifq on shutdown
Date: Wed, 19 Feb 2025 10:08:01 +0000 [thread overview]
Message-ID: <905e55c47235ab26377a735294f939f31d00ae53.1739934175.git.asml.silence@gmail.com> (raw)
io_ring_exit_work() checks ifq before shutting it down and guarantees
that the pointer is stable, but instead of relying on rather complicated
synchronisation recheck the ifq pointer inside.
Reported-by: Kees Bakker <[email protected]>
Signed-off-by: Pavel Begunkov <[email protected]>
---
io_uring/zcrx.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
index 026efb8dd381..a9eaab3fccf2 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c
@@ -489,9 +489,9 @@ void io_shutdown_zcrx_ifqs(struct io_ring_ctx *ctx)
{
lockdep_assert_held(&ctx->uring_lock);
- if (ctx->ifq)
- io_zcrx_scrub(ctx->ifq);
-
+ if (!ctx->ifq)
+ return;
+ io_zcrx_scrub(ctx->ifq);
io_close_queue(ctx->ifq);
}
--
2.48.1
next reply other threads:[~2025-02-19 10:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-19 10:08 Pavel Begunkov [this message]
2025-02-19 15:07 ` [PATCH 1/1] io_uring/zcrx: recheck ifq on shutdown 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 \
--in-reply-to=905e55c47235ab26377a735294f939f31d00ae53.1739934175.git.asml.silence@gmail.com \
[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