Repository navigation
[eve-kernel-arm64-v6.8.12-nvidia-jp7] io_uring/io-wq: apply the current cpuset to new workers - #343
Merged
Conversation
commit 0659e44ce739ecd856164c75a5325b7959a2921d upstream. Since commit 84eacf1 ("io_uring/io-wq: inherit cpuset of cgroup in io worker"), io_wq_create() copies the cpuset of the creating task into wq->cpu_mask, and io_init_new_worker() gives each new worker that copy. A cpuset change, or a move of the task to another cgroup, updates the workers that exist but not the copy, so workers started later run on the CPUs the cgroup had when the io-wq was created, which may since have been given to other tasks. Workers come and go for the life of the io-wq, and a worker that cpuset moved is also retired at its next idle timeout and replaced on the old CPUs. Keep wq->cpu_mask for the affinity of the io-wq itself, all CPUs or the mask set with IORING_REGISTER_IOWQ_AFF, and intersect it with the cpuset of the worker when the worker starts, falling back to the cpuset if the two do not intersect, as __set_cpus_allowed_ptr() does. Use the same mask in the idle exit test, and go back to all CPUs when the registered affinity is removed. Fixes: 84eacf1 ("io_uring/io-wq: inherit cpuset of cgroup in io worker") Cc: stable@vger.kernel.org Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com> Link: https://patch.msgid.link/20261111162705.1150983-1-mike.malyshev@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk> [Backport: applied to NVIDIA's tree under kernel/kernel-noble/. The code is the upstream change; the conflict was only in its context: io_worker_retire(), which precedes the new helpers upstream, is not in this tree.] Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
rene
approved these changes
Nov 19, 2026
rene
approved these changes
Nov 23, 2026
rene
merged commit Nov 23, 2026
7c9a5bb
into
lf-edge:eve-kernel-arm64-v6.8.12-nvidia-jp7
2 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport of #336 to
eve-kernel-arm64-v6.8.12-nvidia-jp7: upstream0659e44ce739"io_uring/io-wq: apply the current cpuset to new workers" (applied by Jens Axboe toio_uring-7.4,Cc: stable; not in a mainline release yet).6.8.12 has the bug:
io_wq_create()copies the creating task's cpuset intowq->cpu_mask(84eacf177faa, "io_uring/io-wq: inherit cpuset of cgroup in io worker"), so io-wq workers started after a cpuset change, or after the task moves to another cgroup, run on the CPUs the cgroup had when the io-wq was created.Key adaptations for eve-kernel-arm64-v6.8.12-nvidia-jp7
io_worker_retire(), which precedes the new helpers upstream (a later io-wq fix), is not in NVIDIA's tree underkernel/kernel-noble/.kernel/kernel-noble/, where this branch keeps the kernel source.Validation
This branch's source built for x86_64 under QEMU/KVM (8 CPUs, cgroup v2, lockdep,
CPUMASK_OFFSTACK; the io-wq code has no architecture-specific parts), the same test as #336:IORING_REGISTER_IOWQ_AFF/ unregisterNo lockdep or sleep-in-atomic reports. arm64:
io_uring/cross-compiled withtegra_eveos_defconfig(NUMA, cpusets on) atW=1: no warnings inio-wq.c. Not run on arm64 hardware.🤖 Generated with Claude Code