liburing: multishot timeout support
v3 cover liburing: multishot timeout support
Changes on the liburing side to support multishot timeouts.
Changes since v2:
* Edited man page for io_uring_prep_timeout.3
David Wei (2):
liburing: add multishot timeout support
liburing: update man page for multishot timeouts
man/io_uring_prep_timeout.3 | 7 + src/include/liburing/io_uring.h | 1 + test/timeout.c | 263 ++++++++++++++++++++++++++++++++ 3 files changed, 271 insertions(+)
Signature · 1 line
2.34.1
PATCH v3 1/2 liburing: add multishot timeout support
Sync the new IORING_TIMEOUT_MULTISHOT flag with kernel.
Add unit tests for multishot timeouts.
--- src/include/liburing/io_uring.h | 1 + test/timeout.c | 263 ++++++++++++++++++++++++++++++++ 2 files changed, 264 insertions(+)
src/include/liburing/io_uring.h +1 -0
@@ -250,6 +250,7 @@ enum io_uring_op {#define IORING_TIMEOUT_REALTIME (1U << 3)#define IORING_LINK_TIMEOUT_UPDATE (1U << 4)#define IORING_TIMEOUT_ETIME_SUCCESS (1U << 5) +#define IORING_TIMEOUT_MULTISHOT (1U << 6)#define IORING_TIMEOUT_CLOCK_MASK (IORING_TIMEOUT_BOOTTIME | IORING_TIMEOUT_REALTIME)#define IORING_TIMEOUT_UPDATE_MASK (IORING_TIMEOUT_UPDATE | IORING_LINK_TIMEOUT_UPDATE)/*
test/timeout.c +263 -0
275 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v3 2/2 liburing: update man page for multishot timeouts
In reply to David Wei--- man/io_uring_prep_timeout.3 | 7 +++++++ 1 file changed, 7 insertions(+)
man/io_uring_prep_timeout.3 +7 -0
@@ -51,6 +51,13 @@ Normally a timeout that triggers would return in a CQE .I res value. +.TP +.B IORING_TIMEOUT_MULTISHOT +The request will return multiple timeout completions. The completion flag +IORING_CQE_F_MORE is set if more timeouts are expected. The value specified in +.I count +is the number of repeats. A value of 0 means the timeout is indefinite and can +only be stopped by a removal request. .PP The timeout completion event will trigger if either the specified timeout has occurred, or the specified number of events to wait for have been posted
Signature · 1 line
2.34.1
Jens Axboe
maintainerQuoted 6 lines · David Wei
Changes on the liburing side to support multishot timeouts.
Changes since v2:
* Edited man page for io_uring_prep_timeout.3
Quoted 8 lines
David Wei (2):
liburing: add multishot timeout support
liburing: update man page for multishot timeoutsman/io_uring_prep_timeout.3 | 7 + src/include/liburing/io_uring.h | 1 + test/timeout.c | 263 ++++++++++++++++++++++++++++++++ 3 files changed, 271 insertions(+)
I applied this, but there's an issue in that the tests don't just skip if the kernel doesn't support multishot. Tests for liburing need to accept that the feature isn't available on older kernels. Generally this is done by the first test setting 'no_timeout_mshot = true' or something like that, and then subsequent ones just returning T_SETUP_SKIP if no_timeout_mshot == true and whatever calls the test not failing if T_SETUP_SKIP is returned.
Would be great if you could send a followup patch against the current liburing -git that does that. Thanks!
Signature · 1 line
Jens Axboe
Quoted 25 lines · Jens Axboe
Quoted 1 line
Quoted 6 lines · David Wei
Changes on the liburing side to support multishot timeouts.
Changes since v2:
* Edited man page for io_uring_prep_timeout.3
Quoted 8 lines
David Wei (2):
liburing: add multishot timeout support
liburing: update man page for multishot timeoutsman/io_uring_prep_timeout.3 | 7 + src/include/liburing/io_uring.h | 1 + test/timeout.c | 263 ++++++++++++++++++++++++++++++++ 3 files changed, 271 insertions(+)I applied this, but there's an issue in that the tests don't just skip if the kernel doesn't support multishot. Tests for liburing need to accept that the feature isn't available on older kernels. Generally this is done by the first test setting '
no_timeout_mshot= true' or something like that, and then subsequent ones just returningT_SETUP_SKIPifno_timeout_mshot== true and whatever calls the test not failing ifT_SETUP_SKIPis returned.
Quoted 2 lines
Would be great if you could send a followup patch against the current liburing -git that does that. Thanks!
Ah I didn't realise, thanks. Will do this and submit a new version.
Quoted 11 lines · David Wei
Changes on the liburing side to support multishot timeouts.
Changes since v2:
* Edited man page for io_uring_prep_timeout.3
David Wei (2):
liburing: add multishot timeout support
liburing: update man page for multishot timeouts[...]
Applied, thanks!
[1/2] liburing: add multishot timeout support
(no commit info)
[2/2] liburing: update man page for multishot timeouts
(no commit info)
Best regards,
Signature · 1 line
Jens Axboe