summaryrefslogtreecommitdiffstats
path: root/io_uring/napi.c
diff options
context:
space:
mode:
Diffstat (limited to 'io_uring/napi.c')
-rw-r--r--io_uring/napi.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/io_uring/napi.c b/io_uring/napi.c
index 6bdb267e9c33..4fd6bb331e1e 100644
--- a/io_uring/napi.c
+++ b/io_uring/napi.c
@@ -282,20 +282,12 @@ int io_unregister_napi(struct io_ring_ctx *ctx, void __user *arg)
* the NAPI timeout accordingly.
*/
void __io_napi_adjust_timeout(struct io_ring_ctx *ctx, struct io_wait_queue *iowq,
- struct timespec64 *ts)
+ ktime_t to_wait)
{
ktime_t poll_dt = READ_ONCE(ctx->napi_busy_poll_dt);
- if (ts) {
- struct timespec64 poll_to_ts;
-
- poll_to_ts = ns_to_timespec64(ktime_to_ns(poll_dt));
- if (timespec64_compare(ts, &poll_to_ts) < 0) {
- s64 poll_to_ns = timespec64_to_ns(ts);
- if (poll_to_ns > 0)
- poll_dt = ns_to_ktime(poll_to_ns);
- }
- }
+ if (to_wait)
+ poll_dt = min(poll_dt, to_wait);
iowq->napi_busy_poll_dt = poll_dt;
}