* [PATCH] io_uring: compare cached_cq_tail with cq.head in_io_uring_poll
@ 2019-09-24 12:53 yangerkun
2019-09-24 13:22 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: yangerkun @ 2019-09-24 12:53 UTC (permalink / raw)
To: hristo, axboe; +Cc: linux-block, yi.zhang, houtao1, yangerkun
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] io_uring: compare cached_cq_tail with cq.head in_io_uring_poll
2019-09-24 12:53 [PATCH] io_uring: compare cached_cq_tail with cq.head in_io_uring_poll yangerkun
@ 2019-09-24 13:22 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2019-09-24 13:22 UTC (permalink / raw)
To: yangerkun, hristo; +Cc: linux-block, yi.zhang, houtao1
On 9/24/19 6:53 AM, yangerkun wrote:
> 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.
Nice catch, applied. BTW, note for future submissions, this:
> Fixes: 75b28af ("io_uring: allocate the two rings together")
sha should be 12 characters. I will fix it up in this one.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-24 13:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-24 12:53 [PATCH] io_uring: compare cached_cq_tail with cq.head in_io_uring_poll yangerkun
2019-09-24 13:22 ` Jens Axboe
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).