Re: [PATCH 07/18] sched/fair: Add push task mechanism for fair

From: Kayra Cizmeci

Date: Sun Oct 18 2026 - 02:58:11 EST


On Fri, Oct 02, 2026 at 05:44:04PM +0200, Vincent Guittot wrote:
> +static void __fair_add_pushable_task(struct rq *rq, struct task_struct *p)
> +{
> + plist_del(&p->pushable_tasks, &rq->cfs.pushable_tasks);
> + plist_node_init(&p->pushable_tasks, p->prio);
> + plist_add(&p->pushable_tasks, &rq->cfs.pushable_tasks);
> +}
> +
> +static void fair_add_pushable_prev(struct rq *rq, struct task_struct *prev, struct task_struct *next)
> +{
> + if (sched_push_task_enabled() && fair_check_pushable_task(rq, prev, next))
> + __fair_add_pushable_task(rq, prev);
> +}
> +
> /*
> * select_task_rq_fair: Select a target runqueue for the task.
> * There are 2 ways to select the target runqueue:
> @@ -10272,6 +10426,12 @@ static void put_prev_task_fair(struct rq *rq, struct task_struct *prev, struct t
> cfs_rq->curr = NULL;
> if (se->on_rq)
> __enqueue_entity(cfs_rq, se);
> +
> + /*
> + * The previous task might be eligible for being pushed on another cpu
> + * if it is still active.
> + */
> + fair_add_pushable_prev(rq, prev, next);
> }
>
> /*



Re-reviewed this :-)

On our rq, we have a fair task TA that holds M mutex. we have a RT task TB blocked on M.
we enter __schedule() and from there pick_next_task(). it chooses TB as next, but it adds
TA to the pushable task list. then we enter the proxy exec path.
donor is set to TB. but when we enter find_proxy_task(), next is changed to
TA. so right now, TA is on the push list even if its still curr.

(With the whole series applied.)

Am I missing something? Should curr not be pushed?

Thanks,


Kayra