Thread (24 messages) 24 messages, 2 authors, 2011-03-29

Re: [PATCH 17/18] powerpc/smp: Increase vdso_data->processorCount, not just decrease it

flat view

From: Michael Ellerman <hidden>
Date: 2011-03-10 03:41:07

On Tue, 2011-03-08 at 17:37 +1100, Benjamin Herrenschmidt wrote:
quoted hunk ↗ jump to hunk
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/kernel/smp.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index e337073..6023395 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -551,6 +551,10 @@ void __devinit start_secondary(void *unused)
 
 	secondary_cpu_time_init();
 
+#ifdef CONFIG_PPC64
+	if (system_state == SYSTEM_RUNNING)
+		vdso_data->processorCount++;
+#endif
So the SYSTEM_RUNNING check is to avoid clashing with the logic in
smp_setup_cpu_maps() I presume:

arch/powerpc/kernel/setup-common.c:     vdso_data->processorCount = num_present_cpus();


But why not remove that, and let the increment in start_secondary() do
all the work?

With the current code if a cpu is present but fails to come up the count
will be wrong I think.

cheers

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help