]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
io_uring: add IO_URING_EXIT_WAIT_MAX definition
authorJens Axboe <axboe@kernel.dk>
Wed, 21 Jan 2026 23:06:41 +0000 (16:06 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 22 Jan 2026 14:25:30 +0000 (07:25 -0700)
Add the timeout we normally wait before complaining about things being
stuck waiting for cancelations to complete as a define, and use it in
io_ring_exit_work().

Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c
io_uring/io_uring.h

index 2cde22af78a3e7e0f938d0866e57b15b63a1ae68..6c9003a3efaec37ca4c45186331c25298e2510dd 100644 (file)
@@ -2962,7 +2962,7 @@ static __cold void io_tctx_exit_cb(struct callback_head *cb)
 static __cold void io_ring_exit_work(struct work_struct *work)
 {
        struct io_ring_ctx *ctx = container_of(work, struct io_ring_ctx, exit_work);
-       unsigned long timeout = jiffies + HZ * 60 * 5;
+       unsigned long timeout = jiffies + IO_URING_EXIT_WAIT_MAX;
        unsigned long interval = HZ / 20;
        struct io_tctx_exit exit;
        struct io_tctx_node *node;
index c5bbb43b584205e3ea5857f07e4959656d0c91f2..2df861200b4f2490aa64ebcad7f57cfaebaebc75 100644 (file)
@@ -88,6 +88,12 @@ struct io_ctx_config {
                        IOSQE_BUFFER_SELECT |\
                        IOSQE_CQE_SKIP_SUCCESS)
 
+/*
+ * Complaint timeout for io_uring cancelation exits, and for io-wq exit
+ * worker waiting.
+ */
+#define IO_URING_EXIT_WAIT_MAX (HZ * 60 * 5)
+
 enum {
        IOU_COMPLETE            = 0,