提交 a8293b97 编写于 作者: P Pavel Begunkov 提交者: Joseph Qi

io_uring: optimise commit_sqring() for common case

to #26323588

commit caf582c652feccd42c50923f0467c4f2dcef279e upstream.

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: NPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Signed-off-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
Acked-by: NXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
上级 11906dda
...@@ -4498,14 +4498,12 @@ static void io_commit_sqring(struct io_ring_ctx *ctx) ...@@ -4498,14 +4498,12 @@ static void io_commit_sqring(struct io_ring_ctx *ctx)
{ {
struct io_rings *rings = ctx->rings; 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,
* Ensure any loads from the SQEs are done at this point, * since once we write the new head, the application could
* since once we write the new head, the application could * write new data to them.
* write new data to them. */
*/ smp_store_release(&rings->sq.head, ctx->cached_sq_head);
smp_store_release(&rings->sq.head, ctx->cached_sq_head);
}
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册