diff options
| author | Wanwu Li <liwanwu@kylinos.cn> | 2026-09-03 11:57:54 +0800 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-09-03 08:00:42 -1000 |
| commit | 8b9b3698796a6b99f43fd09de23bfa5431e0f07e (patch) | |
| tree | efb06bb3e69f98a606ea65bdde6a96a2687c80ba /scripts/Makefile.thinlto | |
| parent | 8848333264b73cb6617fc04e11c245ab1bd22b28 (diff) | |
| download | linux-next-8b9b3698796a6b99f43fd09de23bfa5431e0f07e.tar.gz linux-next-8b9b3698796a6b99f43fd09de23bfa5431e0f07e.zip | |
sched_ext: Protect the idle-search scratch nodemask with irqsave
pick_idle_cpu_from_online_nodes() uses the per-CPU per_cpu_unvisited
nodemask as scratch while walking the online nodes, protected only by
preempt_disable(). preempt_disable() does not mask IRQs and the idle
kfuncs are callable from IRQ-enabled contexts, so a nested invocation
on the same CPU can overwrite the mask with nodes_copy() while the
interrupted invocation is still iterating it, leading to a wrong node
traversal and a wrong idle CPU pick.
Switch to irqsave so a nested invocation can't run on the same CPU.
A stack-allocated nodemask would also close the race, but that would
enlarge the diff to fix a race that is already rare (per-node idle,
CONFIG_NUMA and a cross-node search all at once); irqsave is the
minimal fix for the context that actually triggers it. The NMI case is
deliberately not addressed: there is no legitimate reason to
call pick_idle from NMI and doing so poses no crash risk, so such a
caller is on its own.
Suggested-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/d84b31727f04e1ed0d40042ba1c09e61@kernel.org
Signed-off-by: Wanwu Li <liwanwu@kylinos.cn>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
