From: Gabriel Krisman Bertazi <krisman@suse.de>
To: Pavel Begunkov <asml.silence@gmail.com>
Cc: io-uring@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH for-6.1 1/4] io_uring: update res mask in io_poll_check_events
Date: Thu, 17 Nov 2022 15:31:24 -0500 [thread overview]
Message-ID: <87iljdwcf7.fsf@suse.de> (raw)
In-Reply-To: <2dac97e8f691231049cb259c4ae57e79e40b537c.1668710222.git.asml.silence@gmail.com> (Pavel Begunkov's message of "Thu, 17 Nov 2022 18:40:14 +0000")
Pavel Begunkov <asml.silence@gmail.com> writes:
> When io_poll_check_events() collides with someone attempting to queue a
> task work, it'll spin for one more time. However, it'll continue to use
> the mask from the first iteration instead of updating it. For example,
> if the first wake up was a EPOLLIN and the second EPOLLOUT, the
> userspace will not get EPOLLOUT in time.
>
> Clear the mask for all subsequent iterations to force vfs_poll().
Do we have a reproducer for it in liburing? Either way, I checked the
code, it looks good to me.
Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
>
> Cc: stable@vger.kernel.org
> Fixes: aa43477b04025 ("io_uring: poll rework")
> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
> ---
> io_uring/poll.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/io_uring/poll.c b/io_uring/poll.c
> index f500506984ec..90920abf91ff 100644
> --- a/io_uring/poll.c
> +++ b/io_uring/poll.c
> @@ -258,6 +258,9 @@ static int io_poll_check_events(struct io_kiocb *req, bool *locked)
> return ret;
> }
>
> + /* force the next iteration to vfs_poll() */
> + req->cqe.res = 0;
> +
> /*
> * Release all references, retry if someone tried to restart
> * task_work while we were executing it.
--
Gabriel Krisman Bertazi
next prev parent reply other threads:[~2022-11-17 20:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-17 18:40 [PATCH for-6.1 0/4] minor poll fixes Pavel Begunkov
2022-11-17 18:40 ` [PATCH for-6.1 1/4] io_uring: update res mask in io_poll_check_events Pavel Begunkov
2022-11-17 20:31 ` Gabriel Krisman Bertazi [this message]
2022-11-17 18:40 ` [PATCH for-6.1 2/4] io_uring: fix tw losing poll events Pavel Begunkov
2022-11-17 18:40 ` [PATCH for-6.1 3/4] io_uring: fix multishot accept request leaks Pavel Begunkov
2022-11-17 18:40 ` [PATCH for-6.1 4/4] io_uring: fix multishot recv " Pavel Begunkov
2022-11-17 19:46 ` [PATCH for-6.1 0/4] minor poll fixes 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=87iljdwcf7.fsf@suse.de \
--to=krisman@suse.de \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.