]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sched: Fix migrate_disable_switch() locking
authorPeter Zijlstra <peterz@infradead.org>
Wed, 10 Sep 2025 07:46:44 +0000 (09:46 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 16 Oct 2025 09:13:52 +0000 (11:13 +0200)
commit942b8db965006cf655d356162f7091a9238da94e
treec4607a7f83281f7b53e5d3b9ccbdf99eae76e903
parent6455ad5346c9cf755fa9dda6e326c4028fb3c853
sched: Fix migrate_disable_switch() locking

For some reason migrate_disable_switch() was more complicated than it
needs to be, resulting in mind bending locking of dubious quality.

Recognise that migrate_disable_switch() must be called before a
context switch, but any place before that switch is equally good.
Since the current place results in troubled locking, simply move the
thing before taking rq->lock.

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/sched/core.c