]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sched_ext: selftests/dsp_local_on: Fix sporadic failures
authorTejun Heo <tj@kernel.org>
Fri, 24 Jan 2025 20:48:25 +0000 (10:48 -1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Mar 2025 19:54:15 +0000 (12:54 -0700)
commit05db4968d4bb4045a9a94858045675a8470936ec
treecad69bd6f97dc40d1b27e927ad867eee4ed5c3b2
parent7963b379a37cf31899735e6b0d7113738d477978
sched_ext: selftests/dsp_local_on: Fix sporadic failures

[ Upstream commit e9fe182772dcb2630964724fd93e9c90b68ea0fd ]

dsp_local_on has several incorrect assumptions, one of which is that
p->nr_cpus_allowed always tracks p->cpus_ptr. This is not true when a task
is scheduled out while migration is disabled - p->cpus_ptr is temporarily
overridden to the previous CPU while p->nr_cpus_allowed remains unchanged.

This led to sporadic test faliures when dsp_local_on_dispatch() tries to put
a migration disabled task to a different CPU. Fix it by keeping the previous
CPU when migration is disabled.

There are SCX schedulers that make use of p->nr_cpus_allowed. They should
also implement explicit handling for p->migration_disabled.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Ihor Solodrai <ihor.solodrai@pm.me>
Cc: Andrea Righi <arighi@nvidia.com>
Cc: Changwoo Min <changwoo@igalia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/sched_ext/dsp_local_on.bpf.c