diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2019-12-30 21:24:46 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-01-20 17:04:04 -0700 |
commit | caf582c652feccd42c50923f0467c4f2dcef279e (patch) | |
tree | 444c122dc319de1c2af6e35d4783927a02bb19d1 /fs/io_uring.c | |
parent | ee7d46d9db19ded7b7222af95add63606318a480 (diff) | |
download | lwn-caf582c652feccd42c50923f0467c4f2dcef279e.tar.gz lwn-caf582c652feccd42c50923f0467c4f2dcef279e.zip |
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: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r-- | fs/io_uring.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 3398f4052ec0..8613eae31f4c 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4501,14 +4501,12 @@ 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 - * write new data to them. - */ - smp_store_release(&rings->sq.head, ctx->cached_sq_head); - } + /* + * Ensure any loads from the SQEs are done at this point, + * since once we write the new head, the application could + * write new data to them. + */ + smp_store_release(&rings->sq.head, ctx->cached_sq_head); } /* |