diff options
author | Oleg Nesterov <oleg@redhat.com> | 2025-01-07 17:27:30 +0100 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2025-01-10 11:58:59 +0100 |
commit | 4e15fa8305deecdf20233558ed9f7a8a62b708fd (patch) | |
tree | ca141fdf4f9f7340cb8d787354f4244ed629eada /io_uring | |
parent | poll_wait: kill the obsolete wait_address check (diff) | |
download | linux-4e15fa8305deecdf20233558ed9f7a8a62b708fd.tar.xz linux-4e15fa8305deecdf20233558ed9f7a8a62b708fd.zip |
io_uring_poll: kill the no longer necessary barrier after poll_wait()
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>
Diffstat (limited to 'io_uring')
-rw-r--r-- | io_uring/io_uring.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 06ff41484e29..a64a82b93b86 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2809,13 +2809,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; |