Re: [PATCH] sched/rt: push a queued task when its priority is boosted

From: Steven Rostedt

Date: Mon Nov 30 2026 - 09:16:21 EST


On Sat, 21 Nov 2026 19:31:27 +0800
Chaosheng Qu <chaosheng.qu.linux@xxxxxxxxx> wrote:

> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> index 85303add7..db93bfff7 100644
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -2499,6 +2499,19 @@ prio_changed_rt(struct rq *rq, struct task_struct *p, u64 oldprio)
> */
> if (p->prio < rq->donor->prio)
> resched_curr(rq);
> +
> + /*
> + * A (PI) boost can make @p the highest priority
> + * pushable task on this rq while it still cannot run
> + * here, because the running task is of equal or higher
> + * priority. If @p's affinity excludes the CPUs that
> + * become idle, the pull side cannot pick it and it may
> + * stay queued until the current task schedules out.
> + * Trigger a push for the new priority.
> + */
> + if (oldprio > p->prio && p->nr_cpus_allowed > 1 &&
> + p->prio >= rq->donor->prio)
> + rt_queue_push_tasks(rq);
> }
> }

Nit, it should be an if/else statement:

if (p->prio < rq->donor->prio) {
resched_curr(rq);
} else if (oldprio > p->prio && p->nr_cpus_allowed > 1) {
/*
* The task priority increased but not more than the
* current running task. There may be other CPUs that this
* task can now run on. Let's check for that.
*/
rt_queue_push_tasks(rq);
}

-- Steve