aboutsummaryrefslogtreecommitdiffstats
path: root/io_uring/timeout.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-06-20 01:25:55 +0100
committerJens Axboe <axboe@kernel.dk>2022-07-24 18:39:14 -0600
commit305bef98870816ae58357d647521891ec558a92e (patch)
tree48bd36c78596cd1775b197586d237e8a2bb90524 /io_uring/timeout.c
parentb321823a03dc81a5b83b063e6e1904d612b53266 (diff)
downloadlinux-305bef98870816ae58357d647521891ec558a92e.tar.gz
io_uring: hide eventfd assumptions in eventfd paths
Some io_uring-eventfd users assume that there won't be spurious wakeups. That assumption has to be honoured by all io_cqring_ev_posted() callers, which is inconvenient and from time to time leads to problems but should be maintained to not break the userspace. Instead of making the callers track whether a CQE was posted or not, hide it inside io_eventfd_signal(). It saves ->cached_cq_tail it saw last time and triggers the eventfd only when ->cached_cq_tail changed since then. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/0ffc66bae37a2513080b601e4370e147faaa72c5.1655684496.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/timeout.c')
-rw-r--r--io_uring/timeout.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/io_uring/timeout.c b/io_uring/timeout.c
index a79a7d6ef1b37..424b2fc858b8b 100644
--- a/io_uring/timeout.c
+++ b/io_uring/timeout.c
@@ -629,7 +629,6 @@ __cold bool io_kill_timeouts(struct io_ring_ctx *ctx, struct task_struct *tsk,
spin_unlock_irq(&ctx->timeout_lock);
io_commit_cqring(ctx);
spin_unlock(&ctx->completion_lock);
- if (canceled != 0)
- io_cqring_ev_posted(ctx);
+ io_cqring_ev_posted(ctx);
return canceled != 0;
}