[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251204175405.1511340-5-srikar@linux.ibm.com>
Date: Thu, 4 Dec 2025 23:23:52 +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 04/17] powerpc/smp: Add num_available_cores callback for smp_ops
num_available_cores callback will update the current number of available
cores. If num_available_cores() callback is not defined, then assume
all cores are available.
Signed-off-by: Srikar Dronamraju <srikar@...ux.ibm.com>
---
arch/powerpc/include/asm/smp.h | 3 +++
arch/powerpc/kernel/smp.c | 5 +++++
2 files changed, 8 insertions(+)
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index e41b9ea42122..fe6315057474 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -60,6 +60,9 @@ struct smp_ops_t {
#ifdef CONFIG_HOTPLUG_CPU
void (*cpu_offline_self)(void);
#endif
+#ifdef CONFIG_PPC_SPLPAR
+ unsigned int (*num_available_cores)(void);
+#endif
};
extern struct task_struct *secondary_current;
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 68edb66c2964..c33e9928a2b0 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -1732,6 +1732,11 @@ void __init smp_cpus_done(unsigned int max_cpus)
dump_numa_cpu_topology();
build_sched_topology();
+
+#ifdef CONFIG_PPC_SPLPAR
+ if (smp_ops->num_available_cores)
+ smp_ops->num_available_cores();
+#endif
}
/*
--
2.43.7
Powered by blists - more mailing lists