Re: [PATCH 03/10] sched_ext: Track @p's rq lock across set_cpus_allowed_scx -> ops.set_cpumask

Andrea Righi
2026-04-10T16:12:26Z

On Thu, Apr 09, 2026 at 08:30:39PM -1000, Tejun Heo wrote:
> The SCX_CALL_OP_TASK call site passes rq=NULL incorrectly, leaving
> scx_locked_rq() unset. Pass task_rq(p) instead so update_locked_rq()
> reflects reality.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>

Maybe add:
Fixes: 18853ba782be ("sched_ext: Track currently locked rq")

Apart than that, good catch.

Reviewed-by: Andrea Righi <arighi@nvidia.com>

Thanks,
-Andrea

> ---
> kernel/sched/ext.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> index cf441fb4b1ad..6ca0085903e0 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -3360,7 +3360,7 @@ static void set_cpus_allowed_scx(struct task_struct *p,
> * designation pointless. Cast it away when calling the operation.
> */
> if (SCX_HAS_OP(sch, set_cpumask))
> - SCX_CALL_OP_TASK(sch, SCX_KF_REST, set_cpumask, NULL,
> + SCX_CALL_OP_TASK(sch, SCX_KF_REST, set_cpumask, task_rq(p),
> p, (struct cpumask *)p->cpus_ptr);
> }
>
> --
> 2.53.0
>