[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251204175405.1511340-7-srikar@linux.ibm.com>
Date: Thu, 4 Dec 2025 23:23:54 +0530
From: Srikar Dronamraju <srikar@...ux.ibm.com>
To: linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
Peter Zijlstra <peterz@...radead.org>
Cc: Ben Segall <bsegall@...gle.com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Ingo Molnar <mingo@...nel.org>, Juri Lelli <juri.lelli@...hat.com>,
K Prateek Nayak <kprateek.nayak@....com>,
Madhavan Srinivasan <maddy@...ux.ibm.com>,
Mel Gorman <mgorman@...e.de>, Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>,
Shrikanth Hegde <sshegde@...ux.ibm.com>,
Srikar Dronamraju <srikar@...ux.ibm.com>,
Steven Rostedt <rostedt@...dmis.org>,
Swapnil Sapkal <swapnil.sapkal@....com>,
Thomas Huth <thuth@...hat.com>,
Valentin Schneider <vschneid@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
virtualization@...ts.linux.dev, Yicong Yang <yangyicong@...ilicon.com>,
Ilya Leoshkevich <iii@...ux.ibm.com>
Subject: [PATCH 06/17] powerpc/smp: Delay processing steal time at boot
Before processing steal metrics, system also needs to know the number of
entitled CPUs. Till that time, delay the steal processing till the time
entitlement information is available.
Signed-off-by: Srikar Dronamraju <srikar@...ux.ibm.com>
---
arch/powerpc/kernel/smp.c | 8 ++++++++
arch/powerpc/platforms/pseries/lpar.c | 4 ++++
2 files changed, 12 insertions(+)
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index c33e9928a2b0..016dc7dc5bbc 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -82,6 +82,9 @@ bool has_big_cores __ro_after_init;
bool coregroup_enabled __ro_after_init;
bool thread_group_shares_l2 __ro_after_init;
bool thread_group_shares_l3 __ro_after_init;
+#ifdef CONFIG_PPC_SPLPAR
+bool process_steal_enable __ro_after_init;
+#endif
DEFINE_PER_CPU(cpumask_var_t, cpu_sibling_map);
DEFINE_PER_CPU(cpumask_var_t, cpu_smallcore_map);
@@ -1736,6 +1739,11 @@ void __init smp_cpus_done(unsigned int max_cpus)
#ifdef CONFIG_PPC_SPLPAR
if (smp_ops->num_available_cores)
smp_ops->num_available_cores();
+
+ if (is_shared_processor() && !is_kvm_guest())
+ process_steal_enable = true;
+ else
+ process_steal_enable = false;
#endif
}
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 3431730a10ea..f8e049ac9364 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -674,6 +674,7 @@ static bool should_cpu_process_steal(int cpu)
return false;
}
+extern bool process_steal_enable;
static void process_steal(int cpu)
{
static unsigned long next_tb, prev_steal;
@@ -682,6 +683,9 @@ static void process_steal(int cpu)
unsigned long steal = 0;
unsigned int i;
+ if (!process_steal_enable)
+ return;
+
if (!should_cpu_process_steal(cpu))
return;
--
2.43.7
Powered by blists - more mailing lists