diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2022-06-20 02:25:55 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-07-25 02:39:14 +0200 |
commit | 305bef98870816ae58357d647521891ec558a92e (patch) | |
tree | 48bd36c78596cd1775b197586d237e8a2bb90524 /io_uring/timeout.c | |
parent | io_uring: fix io_poll_remove_all clang warnings (diff) | |
download | linux-305bef98870816ae58357d647521891ec558a92e.tar.xz linux-305bef98870816ae58357d647521891ec558a92e.zip |
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.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/io_uring/timeout.c b/io_uring/timeout.c index a79a7d6ef1b3..424b2fc858b8 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; } |