[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251204175405.1511340-11-srikar@linux.ibm.com>
Date: Thu, 4 Dec 2025 23:23:58 +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 10/17] powerpc/smp: Define arch_update_cpu_topology for shared LPARs
While rebuilding a sched-domain, arch_update_cpu_topology() is a way for
the architecture to tell the scheduler that there are asymmetric CPU
capacities that need to be taken care.
If arch_update_cpu_topology() returns non-zero, then scheduler shall
rebuild the topology post scanning the CPU capacities.
On Powerpc, If there are soft-offlined CPUs, then inform the scheduler
to scan for possible asymmetric CPU capacities.
Signed-off-by: Srikar Dronamraju <srikar@...ux.ibm.com>
---
arch/powerpc/include/asm/smp.h | 3 +++
arch/powerpc/kernel/smp.c | 8 ++++++++
2 files changed, 11 insertions(+)
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index fe6315057474..92842eda1a03 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -269,6 +269,9 @@ extern char __secondary_hold;
extern unsigned int booting_thread_hwid;
extern void __early_start(void);
+#ifdef CONFIG_PPC_SPLPAR
+int arch_update_cpu_topology(void);
+#endif /* CONFIG_PPC_SPLPAR */
#endif /* __ASSEMBLER__ */
#endif /* __KERNEL__ */
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index c269b38dcba5..478847d6ab7c 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -1827,4 +1827,12 @@ unsigned long arch_scale_cpu_capacity(int cpu)
}
return SCHED_CAPACITY_SCALE;
}
+
+int arch_update_cpu_topology(void)
+{
+ if (is_shared_processor() && !is_kvm_guest())
+ return (num_online_cpus() != cpumask_weight(cpu_active_mask));
+
+ return 0;
+}
#endif /* CONFIG_PPC_SPLPAR */
--
2.43.7
Powered by blists - more mailing lists