]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sched: Fix do_set_cpus_allowed() locking
authorPeter Zijlstra <peterz@infradead.org>
Wed, 10 Sep 2025 07:51:06 +0000 (09:51 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 16 Oct 2025 09:13:52 +0000 (11:13 +0200)
commitabfc01077df66593f128d966fdad1d042facc9ac
tree5b0192685eee1a6b6595fb638de9919257b5ebca
parent942b8db965006cf655d356162f7091a9238da94e
sched: Fix do_set_cpus_allowed() locking

All callers of do_set_cpus_allowed() only take p->pi_lock, which is
not sufficient to actually change the cpumask. Again, this is mostly
ok in these cases, but it results in unnecessarily complicated
reasoning.

Furthermore, there is no reason what so ever to not just take all the
required locks, so do just that.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Juri Lelli <juri.lelli@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Vincent Guittot <vincent.guittot@linaro.org>
kernel/kthread.c
kernel/sched/core.c
kernel/sched/sched.h