From: yangerkun <yangerkun@huawei.com>
To: <hristo@venev.name>, <axboe@kernel.dk>
Cc: <linux-block@vger.kernel.org>, <yi.zhang@huawei.com>,
<houtao1@huawei.com>, <yangerkun@huawei.com>
Subject: [PATCH] io_uring: compare cached_cq_tail with cq.head in_io_uring_poll
Date: Tue, 24 Sep 2019 20:53:34 +0800 [thread overview]
Message-ID: <20190924125334.5543-1-yangerkun@huawei.com> (raw)
After 75b28af("io_uring: allocate the two rings together"), we compare
sq.head with cached_cq_tail to determine does there any cq invalid.
Actually, we should use cq.head.
Fixes: 75b28af ("io_uring: allocate the two rings together")
Signed-off-by: yangerkun <yangerkun@huawei.com>
---
fs/io_uring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 0dadbdbead0f..63cbefba1fb5 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -3263,7 +3263,7 @@ static __poll_t io_uring_poll(struct file *file, poll_table *wait)
if (READ_ONCE(ctx->rings->sq.tail) - ctx->cached_sq_head !=
ctx->rings->sq_ring_entries)
mask |= EPOLLOUT | EPOLLWRNORM;
- if (READ_ONCE(ctx->rings->sq.head) != ctx->cached_cq_tail)
+ if (READ_ONCE(ctx->rings->cq.head) != ctx->cached_cq_tail)
mask |= EPOLLIN | EPOLLRDNORM;
return mask;
--
2.17.2
next reply other threads:[~2019-09-24 12:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-24 12:53 yangerkun [this message]
2019-09-24 13:22 ` [PATCH] io_uring: compare cached_cq_tail with cq.head in_io_uring_poll Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190924125334.5543-1-yangerkun@huawei.com \
--to=yangerkun@huawei.com \
--cc=axboe@kernel.dk \
--cc=houtao1@huawei.com \
--cc=hristo@venev.name \
--cc=linux-block@vger.kernel.org \
--cc=yi.zhang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).