Skip to contentSkip to conversation

smp: parallel smp boot option

RFC PATCH New Daniel Walker 3 participants 9 messages Jun 21, 2010 – Jun 22, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 smp: parallel smp boot option

From: Steve Muckle <[email protected]>

Some SMP configurations start all available cores in parallel through the kernel entrypoint, rather than secondary CPUs waiting to be brought out of reset into machine specific startup code.

---
 arch/arm/Kconfig       |    9 +++++++++
 arch/arm/kernel/head.S |    3 +++
 2 files changed, 12 insertions(+), 0 deletions(-)
arch/arm/Kconfig +9 -0
index 021b1d5..39103d2 100644
@@ -1020,6 +1020,15 @@ config NR_CPUS
 	depends on SMP
 	default "4"
 
+config SMP_PARALLEL_START
+	bool "Parallel start of SMP cores"
+	depends on SMP
+	default n
+	help
+	  Say Y here if all CPUs boot to the kernel entrypoint in
+	  parallel, rather than non-master CPUs waiting to be brought
+	  out of reset into machine specific startup code.
+
 config HOTPLUG_CPU
 	bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
 	depends on SMP && HOTPLUG && EXPERIMENTAL
arch/arm/kernel/head.S +3 -0
index 4946c72..9730b7a 100644
@@ -78,6 +78,9 @@
 ENTRY(stext)
 	setmode	PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode
 						@ and irqs disabled
+#ifdef CONFIG_SMP_PARALLEL_START
+	bl	__smp_secondary_spin
+#endif
 	mrc	p15, 0, r9, c0, c0		@ get processor id
 	bl	__lookup_processor_type		@ r5=procinfo r9=cpuid
 	movs	r10, r5				@ invalid processor (r5=0)?
Signature · 5 lines
1.7.1

-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#1 lore raw

RFC PATCH 1/1 smp: parallel smp boot option

arch/arm/kernel/head.S line 83

Quoted 3 lines · Daniel Walker
arch/arm/kernel/head.S +3 -0
+#ifdef CONFIG_SMP_PARALLEL_START
+	bl	__smp_secondary_spin
+#endif

This seems to be half a patch - this doesn't exist.

#2 lore raw

RFC PATCH 1/1 smp: parallel smp boot option

Quoted 6 lines · Russell King - ARM Linux

arch/arm/kernel/head.S line 83

Quoted 3 lines · Daniel Walker
arch/arm/kernel/head.S +3 -0
+#ifdef CONFIG_SMP_PARALLEL_START
+	bl	__smp_secondary_spin
+#endif

This seems to be half a patch - this doesn't exist.

Yeah, I missed part of it. It was spread across two commits.. Also it's against 2.6.32 , so it may be partly out of date.

Daniel

Signature · 2 lines
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#3 lore raw

RFC PATCH 1/1 smp: parallel smp boot option

In reply to Russell King - ARM Linux
Quoted 5 lines · Russell King - ARM Linux

arch/arm/kernel/head.S line 83

Quoted 3 lines · Daniel Walker
arch/arm/kernel/head.S +3 -0
+#ifdef CONFIG_SMP_PARALLEL_START
+	bl	__smp_secondary_spin
+#endif

Your OK with this hook? I was thinking it might be better to check if it's the book cpu or the secondary here instead of in arch/arm/mach-msm .

Steve, do you have any thoughts on that?

Daniel

Signature · 2 lines
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#4 lore raw

RFC PATCH 1/1 smp: parallel smp boot option

Quoted 10 lines · Daniel Walker
Quoted 5 lines · Russell King - ARM Linux

arch/arm/kernel/head.S line 83

Quoted 3 lines · Daniel Walker
arch/arm/kernel/head.S +3 -0
+#ifdef CONFIG_SMP_PARALLEL_START
+	bl	__smp_secondary_spin
+#endif

Your OK with this hook? I was thinking it might be better to check if it's the book cpu or the secondary here instead of in arch/arm/mach-msm .

Not entirely. It would appear that it means you can never used a compressed kernel on MSM, since if you do, you'll have all CPUs in the system decompressing the kernel simultaneously.

If we have to have this hook, how about making it a weak reference rather than something dealt with by the configuration system?

#5 lore raw

RFC PATCH 1/1 smp: parallel smp boot option

Quoted 10 lines
Quoted 3 lines

Your OK with this hook? I was thinking it might be better to check if it's the book cpu or the secondary here instead of in arch/arm/mach-msm .

Not entirely. It would appear that it means you can never used a compressed kernel on MSM, since if you do, you'll have all CPUs in the system decompressing the kernel simultaneously.

If we have to have this hook, how about making it a weak reference rather than something dealt with by the configuration system?

This is something we're using until we get a more complex/featureful bootchain in place. It probably only has value in development platforms/early enablement. A weak reference seems fine or we could drop it alltogether.

thanks,
Steve

--
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

#6 lore raw

RFC PATCH 1/1 smp: parallel smp boot option

In reply to Daniel Walker
Quoted 7 lines · Russell King - ARM Linux
Quoted 5 lines · Daniel Walker

arch/arm/kernel/head.S line 83

Quoted 3 lines
arch/arm/kernel/head.S +3 -0
+#ifdef CONFIG_SMP_PARALLEL_START
+	bl	__smp_secondary_spin
+#endif
Quoted 5 lines

Your OK with this hook? I was thinking it might be better to check if it's the book cpu or the secondary here instead of in arch/arm/mach-msm .

Steve, do you have any thoughts on that?

If we do keep the hook, I think it'd be better to leave it up to the platform specific code to do the test, in case for some reason it's not as simple as reading the MPIDR register. It also keeps the impact to head.S minimal.

thanks,
Steve

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#7 lore raw

RFC PATCH 1/1 msm: initial MSM8X60 early kernel boot support

In reply to Daniel Walker

From: Steve Muckle <[email protected]>

Current MSM8X60 platforms boot all available cores into the kernel entrypoint in parallel.

---
Additional stuff needed to get the last smp patch working, "smp: parallel smp boot option".

 arch/arm/mach-msm/Makefile  |    2 +
 arch/arm/mach-msm/headsmp.S |   57 ++++++++++++++++++++++
 arch/arm/mach-msm/platsmp.c |  112 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 171 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-msm/headsmp.S
 create mode 100644 arch/arm/mach-msm/platsmp.c
arch/arm/mach-msm/Makefile +2 -0
index 31719cd..df0b9ad 100644
@@ -24,6 +24,8 @@ ifdef CONFIG_ARCH_QSD8X50
 	obj-$(CONFIG_MSM_SOC_REV_A) += acpuclock-8x50a.o
 endif
 
+obj-$(CONFIG_SMP) += headsmp.o platsmp.o
+
 obj-$(CONFIG_MSM_CPU_AVS) += avs.o avs_hw.o
 obj-$(CONFIG_CPU_V6) += idle-v6.o
 obj-$(CONFIG_CPU_V7) += idle-v7.o
arch/arm/mach-msm/headsmp.S new file +57 -0

57 lines not on this page · raw message

arch/arm/mach-msm/platsmp.c new file +112 -0

112 lines not on this page · raw message

Signature · 1 line
1.7.1
#8 lore raw

RFC PATCH 1/1 msm: initial MSM8X60 early kernel boot support

arch/arm/mach-msm/platsmp.c line 68

Quoted 12 lines · Daniel Walker
arch/arm/mach-msm/platsmp.c new file +12 -0
+int boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+	int cnt = 0;
+	printk(KERN_DEBUG "Starting secondary CPU %d\n", cpu);
+
+	/* Tell other CPUs to come out or reset.  Note that secondary CPUs
+	 * are probably running with caches off, so we'll need to clean to
+	 * memory. Normal cache ops will only clean to L2.
+	 */
+	pen_release = cpu;
+	dmac_clean_range((void *)&pen_release,
+			 (void *)(&pen_release + sizeof(pen_release)));

dmac_clean_range() and dmac_inv_range() no longer exist.

arch/arm/mach-msm/platsmp.c line 70

Quoted 2 lines
arch/arm/mach-msm/platsmp.c new file +2 -0
+	dmac_clean_range((void *)&secondary_data,
+			 (void *)(&secondary_data + sizeof(secondary_data)));

We've already fixed this.