Skip to content

Commit 4e15fa8

Browse files
oleg-nesterovbrauner
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 10b02a2 commit 4e15fa8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

io_uring/io_uring.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2809,13 +2809,12 @@ static __poll_t io_uring_poll(struct file *file, poll_table *wait)
28092809

28102810
if (unlikely(!ctx->poll_activated))
28112811
io_activate_pollwq(ctx);
2812-
2813-
poll_wait(file, &ctx->poll_wq, wait);
28142812
/*
2815-
* synchronizes with barrier from wq_has_sleeper call in
2816-
* io_commit_cqring
2813+
* provides mb() which pairs with barrier from wq_has_sleeper
2814+
* call in io_commit_cqring
28172815
*/
2818-
smp_rmb();
2816+
poll_wait(file, &ctx->poll_wq, wait);
2817+
28192818
if (!io_sqring_full(ctx))
28202819
mask |= EPOLLOUT | EPOLLWRNORM;
28212820

0 commit comments

Comments
 (0)