Commit caf582c6 authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe
Browse files

io_uring: optimise commit_sqring() for common case



It should be pretty rare to not submitting anything when there is
something in the ring. No need to keep heuristics for this case.

Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent ee7d46d9
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -4501,7 +4501,6 @@ static void io_commit_sqring(struct io_ring_ctx *ctx)
{
	struct io_rings *rings = ctx->rings;

	if (ctx->cached_sq_head != READ_ONCE(rings->sq.head)) {
	/*
	 * Ensure any loads from the SQEs are done at this point,
	 * since once we write the new head, the application could
@@ -4509,7 +4508,6 @@ static void io_commit_sqring(struct io_ring_ctx *ctx)
	 */
	smp_store_release(&rings->sq.head, ctx->cached_sq_head);
}
}

/*
 * Fetch an sqe, if one is available. Note that sqe_ptr will point to memory