Message ID | 228ffcbf30ba98856f66ffdb9a6a60ead1dd96c0.1674484266.git.asml.silence@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | normal tw optimisation + refactoring | expand |
On 1/23/23 7:37 AM, Pavel Begunkov wrote: > We return POLLIN from io_uring_poll() depending on whether there are > CQEs for the userspace, and so we should use the user visible tail > pointer instead of a transient cached value. Should we mark this one for stable as well?
On 1/23/23 18:25, Jens Axboe wrote: > On 1/23/23 7:37 AM, Pavel Begunkov wrote: >> We return POLLIN from io_uring_poll() depending on whether there are >> CQEs for the userspace, and so we should use the user visible tail >> pointer instead of a transient cached value. > > Should we mark this one for stable as well? Yeah, we can. It makes it to overestimate the number of ready CQEs and causes spurious POLLINs, but should be extremely rare and happen only on queue (but not wq wake up).
On 1/23/23 1:56 PM, Pavel Begunkov wrote: > On 1/23/23 18:25, Jens Axboe wrote: >> On 1/23/23 7:37 AM, Pavel Begunkov wrote: >>> We return POLLIN from io_uring_poll() depending on whether there are >>> CQEs for the userspace, and so we should use the user visible tail >>> pointer instead of a transient cached value. >> >> Should we mark this one for stable as well? > Yeah, we can. It makes it to overestimate the number of ready CQEs > and causes spurious POLLINs, but should be extremely rare and happen > only on queue (but not wq wake up). Right, it's not critical, but we may as well.
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index aef30d265a13..c42c1124ad5c 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2888,7 +2888,7 @@ static __poll_t io_uring_poll(struct file *file, poll_table *wait) * pushes them to do the flush. */ - if (io_cqring_events(ctx) || io_has_work(ctx)) + if (__io_cqring_events_user(ctx) || io_has_work(ctx)) mask |= EPOLLIN | EPOLLRDNORM; return mask;
We return POLLIN from io_uring_poll() depending on whether there are CQEs for the userspace, and so we should use the user visible tail pointer instead of a transient cached value. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> --- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)