]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sched_ext: Skip tasks with stale task_rq in bypass_lb_cpu()
authorTejun Heo <tj@kernel.org>
Wed, 13 May 2026 13:01:11 +0000 (15:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 May 2026 15:16:33 +0000 (17:16 +0200)
commit20096df92b7f83342377137da075663ba7469c42
tree16f7f214f912f760581cdec69c8eb86f7004be20
parent33fa2e6b1507a0a377a151a8826438bedad1d0b0
sched_ext: Skip tasks with stale task_rq in bypass_lb_cpu()

commit da2d81b4118a74e65d2335e221a38d665902a98c upstream.

bypass_lb_cpu() transfers tasks between per-CPU bypass DSQs without
migrating them - task_cpu() only updates when the donee later consumes the
task via move_remote_task_to_local_dsq(). If the LB timer fires again before
consumption and the new DSQ becomes a donor, @p is still on the previous CPU
and task_rq(@p) != donor_rq. @p can't be moved without its own rq locked.

Skip such tasks.

Fixes: 95d1df610cdc ("sched_ext: Implement load balancer for bypass mode")
Cc: stable@vger.kernel.org # v6.19+
Reported-by: Chris Mason <clm@meta.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
[ arighi: replace donor_rq with rq, not present in v7.0.y ]
Signed-off-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/sched/ext.c