diff --git a/fs/io_uring.c b/fs/io_uring.c index 965ffa23b0ccdc063350f7c0c9223265613c0c16..72aab64cd4b2c5efd14602ffef4c7a4182553c49 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -3131,11 +3131,11 @@ static bool io_get_sqring(struct io_ring_ctx *ctx, struct sqe_submit *s) */ head = ctx->cached_sq_head; /* make sure SQ entry isn't read before tail */ - if (head == smp_load_acquire(&rings->sq.tail)) + if (unlikely(head == smp_load_acquire(&rings->sq.tail))) return false; head = READ_ONCE(sq_array[head & ctx->sq_mask]); - if (head < ctx->sq_entries) { + if (likely(head < ctx->sq_entries)) { s->ring_file = NULL; s->sqe = &ctx->sq_sqes[head]; s->sequence = ctx->cached_sq_head;