Re: [PATCH v2] sched/rt: Do not account migrate-disabled tasks as pushable

From: Peter Zijlstra

Date: Thu Nov 12 2026 - 10:35:31 EST


On Thu, Nov 12, 2026 at 02:17:29PM +0000, Mel Gorman wrote:

> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> index 1535046a23ff..bb640278d30e 100644
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -396,6 +396,13 @@ static inline void rt_queue_pull_task(struct rq *rq)
>
> static void enqueue_pushable_task(struct rq *rq, struct task_struct *p)
> {
> + if (p->nr_cpus_allowed <= 1)
> + return;
> +#ifdef HAVE_RT_PUSH_IPI
> + if (sched_feat(RT_PUSH_IPI) && is_migration_disabled(p))
> + return;
> +#endif

Is there any down-side from unconditionally having that
is_migration_disabled() test there?

> plist_del(&p->pushable_tasks, &rq->rt.pushable_tasks);
> plist_node_init(&p->pushable_tasks, p->prio);
> plist_add(&p->pushable_tasks, &rq->rt.pushable_tasks);
> @@ -1448,7 +1455,7 @@ enqueue_task_rt(struct rq *rq, struct task_struct *p, int flags)
> if (task_is_blocked(p))
> return;
>
> - if (!task_current(rq, p) && p->nr_cpus_allowed > 1)
> + if (!task_current(rq, p))
> enqueue_pushable_task(rq, p);
> }
>
> @@ -1746,7 +1753,7 @@ static void put_prev_task_rt(struct rq *rq, struct task_struct *p, struct task_s
> * The previous task needs to be made eligible for pushing
> * if it is still active
> */
> - if (on_rt_rq(&p->rt) && p->nr_cpus_allowed > 1)
> + if (on_rt_rq(&p->rt))
> enqueue_pushable_task(rq, p);
> }

And can I ask you to do the same to DL ? Where possible we try and keep
them in-sync.