Skip to content

Commit 408024b

Browse files
isilenceaxboe
authored andcommitted
io_uring: open code io_cqring_overflow_flush()
There is only one caller of io_cqring_overflow_flush(), open code it Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/a1fecd56d9dba923ed8d4d159727fa939d3baa2a.1712708261.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent e45ec96 commit 408024b

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

io_uring/io_uring.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -726,12 +726,6 @@ static void io_cqring_do_overflow_flush(struct io_ring_ctx *ctx)
726726
mutex_unlock(&ctx->uring_lock);
727727
}
728728

729-
static void io_cqring_overflow_flush(struct io_ring_ctx *ctx)
730-
{
731-
if (test_bit(IO_CHECK_CQ_OVERFLOW_BIT, &ctx->check_cq))
732-
io_cqring_do_overflow_flush(ctx);
733-
}
734-
735729
/* can be called by any task */
736730
static void io_put_task_remote(struct task_struct *task)
737731
{
@@ -2452,8 +2446,9 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events,
24522446
if (!llist_empty(&ctx->work_llist))
24532447
io_run_local_work(ctx, min_events);
24542448
io_run_task_work();
2455-
io_cqring_overflow_flush(ctx);
2456-
/* if user messes with these they will just get an early return */
2449+
2450+
if (unlikely(test_bit(IO_CHECK_CQ_OVERFLOW_BIT, &ctx->check_cq)))
2451+
io_cqring_do_overflow_flush(ctx);
24572452
if (__io_cqring_events_user(ctx) >= min_events)
24582453
return 0;
24592454

0 commit comments

Comments
 (0)