[PATCH 3/3] sched/rt: Treat migrate-disabled tasks as pushable if RT_PUSH_IPI is disabled

From: Mel Gorman

Date: Tue Nov 10 2026 - 18:24:56 EST


Migrate-disabled tasks are not accounted as pushable to avoid spurious
IPIs. When RT_PUSH_IPI is unavailable or disabled then there are no IPIs so
pull_rt_task() must find rqs with off-cpu migrate-disabled tasks. It then
can push the running task away allowing the migrate-disabled task to run.

Restore the original accounting of migrate-disabled tasks as pushable if
RT_PUSH_IPI is disabled.

Signed-off-by: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx>
---
kernel/sched/rt.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index cc77683f4897..bb640278d30e 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -396,8 +396,12 @@ 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 || is_migration_disabled(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

plist_del(&p->pushable_tasks, &rq->rt.pushable_tasks);
plist_node_init(&p->pushable_tasks, p->prio);
--
2.55.0