[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250910174210.1969750-7-sshegde@linux.ibm.com>
Date: Wed, 10 Sep 2025 23:12:06 +0530
From: Shrikanth Hegde <sshegde@...ux.ibm.com>
To: mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
vincent.guittot@...aro.org, tglx@...utronix.de, yury.norov@...il.com,
maddy@...ux.ibm.com, linux-kernel@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, gregkh@...uxfoundation.org
Cc: sshegde@...ux.ibm.com, vschneid@...hat.com, iii@...ux.ibm.com,
huschle@...ux.ibm.com, rostedt@...dmis.org, dietmar.eggemann@....com,
vineeth@...byteword.org, jgross@...e.com, pbonzini@...hat.com,
seanjc@...gle.com
Subject: [RFC PATCH v3 06/10] sched/rt: Don't select paravirt CPU for wakeup and push/pull rt task
For RT class,
- During wakeup don't select a paravirt CPU.
- Don't pull a task towards a paravirt CPU.
- Don't push a task to a paravirt CPU.
Signed-off-by: Shrikanth Hegde <sshegde@...ux.ibm.com>
---
kernel/sched/rt.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 7936d4333731..54bfac66624b 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -1552,6 +1552,9 @@ select_task_rq_rt(struct task_struct *p, int cpu, int flags)
if (!test && target != -1 && !rt_task_fits_capacity(p, target))
goto out_unlock;
+ /* Avoid moving to a paravirt CPU */
+ if (is_cpu_paravirt(target))
+ goto out_unlock;
/*
* Don't bother moving it if the destination CPU is
* not running a lower priority task.
@@ -1876,7 +1879,7 @@ static struct rq *find_lock_lowest_rq(struct task_struct *task, struct rq *rq)
for (tries = 0; tries < RT_MAX_TRIES; tries++) {
cpu = find_lowest_rq(task);
- if ((cpu == -1) || (cpu == rq->cpu))
+ if ((cpu == -1) || (cpu == rq->cpu) || is_cpu_paravirt(cpu))
break;
lowest_rq = cpu_rq(cpu);
@@ -1974,7 +1977,7 @@ static int push_rt_task(struct rq *rq, bool pull)
return 0;
cpu = find_lowest_rq(rq->curr);
- if (cpu == -1 || cpu == rq->cpu)
+ if (cpu == -1 || cpu == rq->cpu || is_cpu_paravirt(cpu))
return 0;
/*
@@ -2237,6 +2240,10 @@ static void pull_rt_task(struct rq *this_rq)
if (likely(!rt_overload_count))
return;
+ /* There is no point in pulling the task towards a paravirt cpu */
+ if (is_cpu_paravirt(this_rq->cpu))
+ return;
+
/*
* Match the barrier from rt_set_overloaded; this guarantees that if we
* see overloaded we must also see the rto_mask bit.
--
2.47.3
Powered by blists - more mailing lists