summaryrefslogtreecommitdiff
path: root/io_uring/napi.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2024-08-07 15:18:14 +0100
committerJens Axboe <axboe@kernel.dk>2024-08-25 08:27:01 -0600
commit2b8e976b984278edbeab3251d370e76d237699f9 (patch)
treef91366b1a924921fc52d4fa43c8868dd3f30709d /io_uring/napi.c
parentd29cb3726f03cdac7889f0109a7cb84f79e168a8 (diff)
downloadlinux-2b8e976b984278edbeab3251d370e76d237699f9.tar.gz
linux-2b8e976b984278edbeab3251d370e76d237699f9.tar.bz2
linux-2b8e976b984278edbeab3251d370e76d237699f9.zip
io_uring: user registered clockid for wait timeouts
Add a new registration opcode IORING_REGISTER_CLOCK, which allows the user to select which clock id it wants to use with CQ waiting timeouts. It only allows a subset of all posix clocks and currently supports CLOCK_MONOTONIC and CLOCK_BOOTTIME. Suggested-by: Lewis Baker <lewissbaker@gmail.com> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/98f2bc8a3c36cdf8f0e6a275245e81e903459703.1723039801.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/napi.c')
-rw-r--r--io_uring/napi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/napi.c b/io_uring/napi.c
index d78fcbecdd27..d0cf694d0172 100644
--- a/io_uring/napi.c
+++ b/io_uring/napi.c
@@ -283,7 +283,7 @@ void __io_napi_busy_loop(struct io_ring_ctx *ctx, struct io_wait_queue *iowq)
iowq->napi_busy_poll_dt = READ_ONCE(ctx->napi_busy_poll_dt);
if (iowq->timeout != KTIME_MAX) {
- ktime_t dt = ktime_sub(iowq->timeout, ktime_get());
+ ktime_t dt = ktime_sub(iowq->timeout, io_get_time(ctx));
iowq->napi_busy_poll_dt = min_t(u64, iowq->napi_busy_poll_dt, dt);
}