projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
713b982
)
io_uring: fix missing mb() before waitqueue_active
author
Pavel Begunkov
<asml.silence@gmail.com>
Wed, 8 Sep 2021 19:49:17 +0000
(20:49 +0100)
committer
Jens Axboe
<axboe@kernel.dk>
Wed, 8 Sep 2021 19:57:56 +0000
(13:57 -0600)
In case of !SQPOLL, io_cqring_ev_posted_iopoll() doesn't provide a
memory barrier required by waitqueue_active(&ctx->poll_wait). There is
a wq_has_sleeper(), which does smb_mb() inside, but it's called only for
SQPOLL.
Fixes:
5fd4617840596
("io_uring: be smarter about waking multiple CQ ring waiters")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link:
https://lore.kernel.org/r/2982e53bcea2274006ed435ee2a77197107d8a29.1631130542.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c
patch
|
blob
|
history
diff --git
a/fs/io_uring.c
b/fs/io_uring.c
index
d816c09
..
d80d835
100644
(file)
--- a/
fs/io_uring.c
+++ b/
fs/io_uring.c
@@
-1619,8
+1619,11
@@
static void io_cqring_ev_posted(struct io_ring_ctx *ctx)
static void io_cqring_ev_posted_iopoll(struct io_ring_ctx *ctx)
{
+ /* see waitqueue_active() comment */
+ smp_mb();
+
if (ctx->flags & IORING_SETUP_SQPOLL) {
- if (w
q_has_sleeper
(&ctx->cq_wait))
+ if (w
aitqueue_active
(&ctx->cq_wait))
wake_up_all(&ctx->cq_wait);
}
if (io_should_trigger_evfd(ctx))