]> git.ipfire.org Git - thirdparty/linux.git/commit
io_uring/io-wq: add exit-on-idle state
authorLi Chen <me@linux.beauty>
Mon, 2 Feb 2026 14:37:53 +0000 (22:37 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 2 Feb 2026 15:10:23 +0000 (08:10 -0700)
commit38aa434ab9335ce2d178b7538cdf01d60b2014c3
treeb8e82b33e08362432b0b8eca07580e22050da37e
parent806ae939c41e5da1d94a1e2b31f5702e96b6c3e3
io_uring/io-wq: add exit-on-idle state

io-wq uses an idle timeout to shrink the pool, but keeps the last worker
around indefinitely to avoid churn.

For tasks that used io_uring for file I/O and then stop using io_uring,
this can leave an iou-wrk-* thread behind even after all io_uring
instances are gone. This is unnecessary overhead and also gets in the
way of process checkpoint/restore.

Add an exit-on-idle state that makes all io-wq workers exit as soon as
they become idle, and provide io_wq_set_exit_on_idle() to toggle it.

Signed-off-by: Li Chen <me@linux.beauty>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io-wq.c
io_uring/io-wq.h