summaryrefslogtreecommitdiff
path: root/io_uring/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-12-02 17:47:24 +0000
committerJens Axboe <axboe@kernel.dk>2022-12-14 08:53:35 -0700
commite5f30f6fb29a0b8fa7ca784e44571a610b949b04 (patch)
treee5214e50f664bc3f0f8324aebe5c20866ff01726 /io_uring/io_uring.c
parent6971253f078766543c716db708ba2c787826690d (diff)
io_uring: ease timeout flush locking requirements
We don't need completion_lock for timeout flushing, don't take it. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/1e3dc657975ac445b80e7bdc40050db783a5935a.1670002973.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/io_uring.c')
-rw-r--r--io_uring/io_uring.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 698c54f951ea..fc64072c53eb 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -572,12 +572,11 @@ static void io_eventfd_flush_signal(struct io_ring_ctx *ctx)
void __io_commit_cqring_flush(struct io_ring_ctx *ctx)
{
- if (ctx->off_timeout_used || ctx->drain_active) {
+ if (ctx->off_timeout_used)
+ io_flush_timeouts(ctx);
+ if (ctx->drain_active) {
spin_lock(&ctx->completion_lock);
- if (ctx->off_timeout_used)
- io_flush_timeouts(ctx);
- if (ctx->drain_active)
- io_queue_deferred(ctx);
+ io_queue_deferred(ctx);
spin_unlock(&ctx->completion_lock);
}
if (ctx->has_evfd)