public inbox for [email protected]
 help / color / mirror / Atom feed
From: David Wei <[email protected]>
To: Dylan Yudaken <[email protected]>
Cc: Jens Axboe <[email protected]>,
	Pavel Begunkov <[email protected]>,
	[email protected]
Subject: Re: [PATCH v3] io_uring: add support for multishot timeouts
Date: Fri, 14 Apr 2023 14:38:37 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAO_YeojHXRtCBRuOOvzcyQ125E3w3hwkFHjS5Z2QhWUiZYqrTQ@mail.gmail.com>

Hi Dylan! Good to see you :D

On 14/04/2023 14:07, Dylan Yudaken wrote:
> > 
> On Fri, Apr 14, 2023 at 9:14 PM David Wei <[email protected]> wrote:
>>
>> A multishot timeout submission will repeatedly generate completions with
>> the IORING_CQE_F_MORE cflag set. Depending on the value of the `off'
>> field in the submission, these timeouts can either repeat indefinitely
>> until cancelled (`off' = 0) or for a fixed number of times (`off' > 0).
>>
>> Only noseq timeouts (i.e. not dependent on the number of I/O
>> completions) are supported.
>>
>> An indefinite timer will be cancelled with EOVERFLOW if the CQ ever
>> overflows.
>>
>> Signed-off-by: David Wei <[email protected]>
> 
> ...
> 
>> +static void io_timeout_complete(struct io_kiocb *req, struct io_tw_state *ts)
>> +{
>> +       struct io_timeout *timeout = io_kiocb_to_cmd(req, struct io_timeout);
>> +       struct io_timeout_data *data = req->async_data;
>> +       struct io_ring_ctx *ctx = req->ctx;
>> +
>> +       if (!io_timeout_finish(timeout, data)) {
>> +               bool filled;
>> +               filled = io_aux_cqe(ctx, false, req->cqe.user_data, -ETIME,
>> +                                   IORING_CQE_F_MORE, false);
> 
> I think that the defer parameter (the first false) might want to be ts->locked.

Ah you're right, thanks, will change!

      reply	other threads:[~2023-04-14 21:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14 20:13 [PATCH v3] io_uring: add support for multishot timeouts David Wei
2023-04-14 21:07 ` Dylan Yudaken
2023-04-14 21:38   ` David Wei [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] \
    [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