History

io_uring: support CLOCK_BOOTTIME/REALTIME for timeouts

Certain use cases want to use CLOCK_BOOTTIME or CLOCK_REALTIME rather than CLOCK_MONOTONIC, instead of the default CLOCK_MONOTONIC. Add an IORING_TIMEOUT_BOOTTIME and IORING_TIMEOUT_REALTIME flag that allows timeouts and linked timeouts to use the selected clock source. Only one clock source may be selected, and we -EINVAL the request if more than one is given. If neither BOOTIME nor REALTIME are selected, the previous default of MONOTONIC is used.

Jens Axboe committed 5 years ago

Commit 50c1df21 parent 2e480052 files · +27 −3Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/io_uring.h+3−0
@@ -151,6 +151,9 @@ enum { · 150 unmodified lines
151151 */
152152 #define IORING_TIMEOUT_ABS (1U << 0)
153153 #define IORING_TIMEOUT_UPDATE (1U << 1)
154+#define IORING_TIMEOUT_BOOTTIME (1U << 2)
155+#define IORING_TIMEOUT_REALTIME (1U << 3)
156+#define IORING_TIMEOUT_CLOCK_MASK (IORING_TIMEOUT_BOOTTIME | IORING_TIMEOUT_REALTIME)
154157
155158 /*
156159 * sqe->splice_flags