All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: stable@vger.kernel.org
Cc: io-uring@vger.kernel.org, gregkh@linuxfoundation.org
Subject: [PATCH 6.12.y 13/15] io_uring_poll: kill the no longer necessary barrier after poll_wait()
Date: Sat,  5 Dec 2026 23:11:05 +0000	[thread overview]
Message-ID: <20261205231107.4023506-14-axboe@kernel.dk> (raw)
In-Reply-To: <20261205231107.4023506-1-axboe@kernel.dk>

From: Oleg Nesterov <oleg@redhat.com>

Commit 4e15fa8305deecdf20233558ed9f7a8a62b708fd upstream.

Now that poll_wait() provides a full barrier we can remove smp_rmb() from
io_uring_poll().

In fact I don't think smp_rmb() was correct, it can't serialize LOADs and
STOREs.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Link: https://lore.kernel.org/r/20250107162730.GA18940@redhat.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
 io_uring/io_uring.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 98cba5672475..0ad03f222bf5 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -2912,13 +2912,12 @@ static __poll_t io_uring_poll(struct file *file, poll_table *wait)
 
 	if (unlikely(!ctx->poll_activated))
 		io_activate_pollwq(ctx);
-
-	poll_wait(file, &ctx->poll_wq, wait);
 	/*
-	 * synchronizes with barrier from wq_has_sleeper call in
-	 * io_commit_cqring
+	 * provides mb() which pairs with barrier from wq_has_sleeper
+	 * call in io_commit_cqring
 	 */
-	smp_rmb();
+	poll_wait(file, &ctx->poll_wq, wait);
+
 	if (!io_sqring_full(ctx))
 		mask |= EPOLLOUT | EPOLLWRNORM;
 
-- 
2.55.0


  parent reply	other threads:[~2026-12-05 23:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05 23:10 [PATCH 6.12.y 00/15] io_uring fixes for 6.12-stable Jens Axboe
2026-12-05 23:10 ` [PATCH 6.12.y 01/15] io_uring/net: don't charge the folio offset to truesize for managed frags Jens Axboe
2026-12-05 23:10 ` [PATCH 6.12.y 02/15] io_uring/net: don't copy msg_name on a recvmsg retry Jens Axboe
2026-12-05 23:10 ` [PATCH 6.12.y 03/15] io_uring/kbuf: clear REQ_F_BL_NO_RECYCLE on buffer put Jens Axboe
2026-12-05 23:10 ` [PATCH 6.12.y 04/15] io_uring/tctx: add separate lock for list of tctx's in ctx Jens Axboe
2026-12-05 23:10 ` [PATCH 6.12.y 05/15] io_uring: free the task context after a grace period Jens Axboe
2026-12-05 23:10 ` [PATCH 6.12.y 06/15] io_uring: free the ring " Jens Axboe
2026-12-05 23:10 ` [PATCH 6.12.y 07/15] io_uring/filetable: don't install O_PATH files Jens Axboe
2026-12-05 23:11 ` [PATCH 6.12.y 08/15] io_uring: make ctx->timeout_lock a raw spinlock Jens Axboe
2026-12-05 23:11 ` [PATCH 6.12.y 09/15] io_uring/timeout: flush timeouts outside of the timeout lock Jens Axboe
2026-12-05 23:11 ` [PATCH 6.12.y 10/15] io_uring/cancel: always walk links under timeout_lock Jens Axboe
2026-12-05 23:11 ` [PATCH 6.12.y 11/15] io_uring/net: don't count the buffers of a send bundle Jens Axboe
2026-12-05 23:11 ` [PATCH 6.12.y 12/15] io_uring/net: restore the cmsg buffer on recvmsg retry Jens Axboe
2026-12-05 23:11 ` Jens Axboe [this message]
2026-12-05 23:11 ` [PATCH 6.12.y 14/15] io_uring: close poll activation race when enabling rings Jens Axboe
2026-12-05 23:11 ` [PATCH 6.12.y 15/15] io_uring/cancel: arm local work wakeups only for submitter 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=20261205231107.4023506-14-axboe@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=gregkh@linuxfoundation.org \
    --cc=io-uring@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.