Skip to content

Commit dd120bd

Browse files
committed
io_uring: add IO_URING_EXIT_WAIT_MAX definition
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>
1 parent 649dd18 commit dd120bd

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

io_uring/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2962,7 +2962,7 @@ static __cold void io_tctx_exit_cb(struct callback_head *cb)
29622962
static __cold void io_ring_exit_work(struct work_struct *work)
29632963
{
29642964
struct io_ring_ctx *ctx = container_of(work, struct io_ring_ctx, exit_work);
2965-
unsigned long timeout = jiffies + HZ * 60 * 5;
2965+
unsigned long timeout = jiffies + IO_URING_EXIT_WAIT_MAX;
29662966
unsigned long interval = HZ / 20;
29672967
struct io_tctx_exit exit;
29682968
struct io_tctx_node *node;

io_uring/io_uring.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ struct io_ctx_config {
8888
IOSQE_BUFFER_SELECT |\
8989
IOSQE_CQE_SKIP_SUCCESS)
9090

91+
/*
92+
* Complaint timeout for io_uring cancelation exits, and for io-wq exit
93+
* worker waiting.
94+
*/
95+
#define IO_URING_EXIT_WAIT_MAX (HZ * 60 * 5)
96+
9197
enum {
9298
IOU_COMPLETE = 0,
9399

0 commit comments

Comments
 (0)