Re: [PATCH sched_ext/for-6.12-fixes] sched_ext: Call __balance_callbacks() from __scx_task_iter_rq_unlock()
From: Peter Zijlstra
Date: Thu Oct 31 2024 - 19:37:02 EST
On Wed, Oct 30, 2024 at 11:41:39AM -1000, Tejun Heo wrote:
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -1315,6 +1315,8 @@ static void scx_task_iter_start(struct s
> static void __scx_task_iter_rq_unlock(struct scx_task_iter *iter)
> {
> if (iter->locked) {
> + /* ->switched_from() may have scheduled balance callbacks */
> + __balance_callbacks(iter->rq);
> task_rq_unlock(iter->rq, iter->locked, &iter->rf);
> iter->locked = NULL;
> }
I think you need to unpin/repin around it. The balance callbacks like to
drop rq->lock at times.