Skip to content

Commit 5d77291

Browse files
isilenceaxboe
authored andcommitted
io_uring: keep unlock_post inlined in hot path
This partially reverts 6c16fe3 ("io_uring: kill io_cqring_ev_posted() and __io_cq_unlock_post()") The redundancy of __io_cq_unlock_post() was always to keep it inlined into __io_submit_flush_completions(). Inline it back and rename with hope of clarifying the intention behind it. Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/372a16c485fca44c069be2e92fc5e7332a1d7fd7.1669310258.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent c3b4909 commit 5d77291

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

io_uring/io_uring.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,8 @@ void __io_commit_cqring_flush(struct io_ring_ctx *ctx)
582582
io_eventfd_flush_signal(ctx);
583583
}
584584

585-
void io_cq_unlock_post(struct io_ring_ctx *ctx)
585+
/* keep it inlined for io_submit_flush_completions() */
586+
static inline void io_cq_unlock_post_inline(struct io_ring_ctx *ctx)
586587
__releases(ctx->completion_lock)
587588
{
588589
io_commit_cqring(ctx);
@@ -592,6 +593,12 @@ void io_cq_unlock_post(struct io_ring_ctx *ctx)
592593
io_cqring_wake(ctx);
593594
}
594595

596+
void io_cq_unlock_post(struct io_ring_ctx *ctx)
597+
__releases(ctx->completion_lock)
598+
{
599+
io_cq_unlock_post_inline(ctx);
600+
}
601+
595602
/* Returns true if there are no backlogged entries after the flush */
596603
static bool __io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool force)
597604
{
@@ -1389,7 +1396,7 @@ static void __io_submit_flush_completions(struct io_ring_ctx *ctx)
13891396
if (!(req->flags & REQ_F_CQE_SKIP))
13901397
__io_fill_cqe_req(ctx, req);
13911398
}
1392-
io_cq_unlock_post(ctx);
1399+
io_cq_unlock_post_inline(ctx);
13931400

13941401
if (!wq_list_empty(&ctx->submit_state.compl_reqs)) {
13951402
io_free_batch_list(ctx, state->compl_reqs.first);

0 commit comments

Comments
 (0)