Skip to content

Conversation

@FirstLoveLife
Copy link

This adds a liburing regression test that exercises io_uring creating an io-wq
worker (iou-wrk-) and verifies that the worker does not linger once the
last ring is closed.

On kernels without the corresponding io-wq change, the test reliably fails
because an idle iou-wrk thread can remain in the thread group indefinitely.
With the kernel change applied, the same workload passes, as the worker exits
shortly after the last ring is closed.

The test triggers io-wq by issuing regular file I/O via io_uring (splice
through a pipe), checks that iou-wrk appears under /proc/self/task, closes the
ring, and then waits up to 2s for all iou-wrk threads to disappear.

To run the test, build liburing and run ./test/io-wq-unused-exit.t.


git request-pull output:

The following changes since commit 14000b9c0dc5d67057a81f664a8c03fce99a0943:

  test/conn-unreach: fix bad res value (2026-01-31 15:46:39 -0700)

are available in the Git repository at:

  https://github.com/FirstLoveLife/liburing.git idle

for you to fetch changes up to 3f6d38262de451664cda99970f8fe9d55d8dd4bc:

  test/io-wq: verify unused workers exit (2026-02-03 12:34:00 +0800)

----------------------------------------------------------------
Li Chen (1):
      test/io-wq: verify unused workers exit

 test/Makefile            |   1 +
 test/io-wq-unused-exit.c | 221 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 222 insertions(+)
 create mode 100644 test/io-wq-unused-exit.c

Create io-wq worker(s) via io_uring and verify they do not linger after
the last ring is closed.

This is useful for long-running workloads that quiesce and close their
io_uring instances before checkpoint/restore.

Signed-off-by: Li Chen <me@linux.beauty>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant