From: Jens Axboe <[email protected]>
To: Hao Xu <[email protected]>, [email protected]
Subject: Re: [PATCH 9/9] io_uring: allow events update of running poll requests
Date: Fri, 19 Mar 2021 07:37:22 -0600 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 3/18/21 9:31 PM, Hao Xu wrote:
>> @@ -5382,24 +5387,32 @@ static int io_poll_add_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe
>>
>> if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL))
>> return -EINVAL;
>> - if (sqe->addr || sqe->ioprio || sqe->off || sqe->buf_index)
>> + if (sqe->ioprio || sqe->off || sqe->buf_index)
>> return -EINVAL;
>> flags = READ_ONCE(sqe->len);
>> - if (flags & ~IORING_POLL_ADD_MULTI)
>> + if (flags & ~(IORING_POLL_ADD_MULTI | IORING_POLL_UPDATE))
>> return -EINVAL;
>>
>> events = READ_ONCE(sqe->poll32_events);
>> #ifdef __BIG_ENDIAN
>> events = swahw32(events);
>> #endif
>> - if (!flags)
>> + if (!(flags & IORING_POLL_ADD_MULTI))
>> events |= EPOLLONESHOT;
>> + if (flags & IORING_POLL_UPDATE) {
>> + poll->update = true;
>> + poll->addr = READ_ONCE(sqe->addr);
>> + } else {
>> + if (sqe->addr)
>> + return -EINVAL;
>> + poll->update = false;
> Hi Jens, is `poll->update = false` redundant?
Don't think so, the one in io_init_poll_iocb() is probably though.
Better safe than sorry... I did rework these bits in the latest, because
it has two separate flags instead of just the one.
--
Jens Axboe
prev parent reply other threads:[~2021-03-19 13:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-17 16:29 [PATCHSET for-next 0/9] Poll improvements Jens Axboe
2021-03-17 16:29 ` [PATCH 1/9] io_uring: correct comment on poll vs iopoll Jens Axboe
2021-03-17 16:29 ` [PATCH 2/9] io_uring: transform ret == 0 for poll cancelation completions Jens Axboe
2021-03-17 16:29 ` [PATCH 3/9] io_uring: allocate memory for overflowed CQEs Jens Axboe
2021-03-17 16:29 ` [PATCH 4/9] io_uring: include cflags in completion trace event Jens Axboe
2021-03-17 16:29 ` [PATCH 5/9] io_uring: add multishot mode for IORING_OP_POLL_ADD Jens Axboe
2021-03-17 16:29 ` [PATCH 6/9] io_uring: abstract out helper for removing poll waitqs/hashes Jens Axboe
2021-03-17 16:29 ` [PATCH 7/9] io_uring: terminate multishot poll for CQ ring overflow Jens Axboe
2021-03-17 16:29 ` [PATCH 8/9] io_uring: abstract out a io_poll_find_helper() Jens Axboe
2021-03-17 16:29 ` [PATCH 9/9] io_uring: allow events update of running poll requests Jens Axboe
2021-03-19 3:31 ` Hao Xu
2021-03-19 13:37 ` Jens Axboe [this message]
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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