Re: [PATCH 4/6 v8] sched/fair: Add push task mechanism for fair

From: Dietmar Eggemann
Date: Wed Dec 10 2025 - 09:01:43 EST


- hongyan.xia2@xxxxxxx
- luis.machado@xxxxxxx

On 02.12.25 19:12, Vincent Guittot wrote:
> EAS is based on wakeup events to efficiently place tasks on the system, but
> there are cases where a task doesn't have wakeup events anymore or at a far
> too low pace. For such situation, we can take advantage of the task being
> put back in the enqueued list to check if it should be pushed on another
> CPU.
> When the task is alone on the CPU, it's never put back in the enqueued
> list; In this special case, we use the tick to run the check.
>
> Add a push task mechanism that enables fair scheduler to push runnable
> tasks. EAS will be one user but other feature like filling idle CPUs
> can also take advantage of it.

[...]

> +/*
> + * See if the non running fair tasks on this rq can be sent on other CPUs
> + * that fits better with their profile.
> + */
> +static bool push_fair_task(struct rq *rq)
> +{
> + struct task_struct *next_task;
> + int prev_cpu, new_cpu;
> + struct rq *new_rq;
> +
> + next_task = pick_next_pushable_fair_task(rq);
> + if (!next_task)
> + return false;
> +
> + if (is_migration_disabled(next_task))
> + return true;
> +
> + /* We might release rq lock */
> + get_task_struct(next_task);
> +
> + prev_cpu = rq->cpu;
> +

select_task_rq_fair() requires p->pi_lock to be held. I assume
check_pushable_task() (push single running task) has the same issue.

> + new_cpu = select_task_rq_fair(next_task, prev_cpu, 0);
> +

[...]