test/iowq-cpuset: check that io-wq workers follow cpuset changes
PATCH 1/1 test/iowq-cpuset: check that io-wq workers follow cpuset changes
io-wq workers started after the cpuset of a task changes, or after the task moves to another cgroup, run on the CPUs the task had when its io-wq was created: the kernel reads the cpuset only then. The kernel fix is "io_uring/io-wq: apply the current cpuset to new workers".
Add a test that starts a worker on one CPU, moves the task to another CPU, once by changing its cpuset and once by moving it to another cgroup, starts three more workers, and checks that all of them run on the new CPU only. It needs root and cgroup v2 with the cpuset controller, and skips otherwise.
---
The kernel fix: https://lore.kernel.org/io-uring/[email protected]/
On io_uring-7.4 under QEMU/KVM (x86_64, 8 CPUs, cgroup v2) the test fails without the kernel fix, at its first subtest (the cpuset change), and passes with it; the same on 6.18.y. Without root it skips.
The test was written with Claude Code (Anthropic, Claude Opus 5.5) together with the kernel fix; I have reviewed it.
test/Makefile | 1 + test/iowq-cpuset.c | 330 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 331 insertions(+) create mode 100644 test/iowq-cpuset.c
test/Makefile +1 -0
@@ -159,6 +159,7 @@ test_srcs := \ io-wq-exit.c \ io-wq-unused-exit.c \ iowait.c \ + iowq-cpuset.c \ kallsyms.c \ large-resize.c \ lfs-openat.c \
test/iowq-cpuset.c new file +330 -0
330 lines not on this page · raw message
base-commit: 67bc5dcc7dc31b81bc623074887e2a231ede3b54
Signature · 1 line
2.43.0