Skip to contentSkip to conversation

ppc32: set smp_tb_synchronized on UP with SMP kernel

PATCH In review Johannes Berg 2 participants 4 messages Dec 10, 2005 – Dec 11, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc32: set smp_tb_synchronized on UP with SMP kernel

ppc32 kernel, when built with CONFIG_SMP and booted on a single CPU machine, will not properly set smp_tb_synchronized, thus causing gettimeofday() to not use the HW timebase and to be limited to jiffy resolution. This, among others, causes unacceptable pauses when launching X.org.

---

With this patch, X.org startup time goes down from ~30 seconds to normal (just a second or so). The know-how really comes from BenH who I discussed with on IRC.

arch/ppc/kernel/smp.c +5 -0
@@ -301,6 +301,11 @@
 
 	/* Probe platform for CPUs: always linear. */
 	num_cpus = smp_ops->probe();
+	
+	if (num_cpus < 2) {
+		smp_tb_synchronized = 1;
+	}
+	
 	for (i = 0; i < num_cpus; ++i)
 		cpu_set(i, cpu_possible_map);
 
#1 lore raw
Quoted 7 lines · Johannes Berg

ppc32 kernel, when built with CONFIG_SMP and booted on a single CPU machine, will not properly set smp_tb_synchronized, thus causing gettimeofday() to not use the HW timebase and to be limited to jiffy resolution. This, among others, causes unacceptable pauses when launching X.org.

Please, remove the useless { }

Ben.

Quoted 21 lines

---

With this patch, X.org startup time goes down from ~30 seconds to normal (just a second or so). The know-how really comes from BenH who I discussed with on IRC.

arch/ppc/kernel/smp.c +5 -0
@@ -301,6 +301,11 @@
 
 	/* Probe platform for CPUs: always linear. */
 	num_cpus = smp_ops->probe();
+	
+	if (num_cpus < 2) {
+		smp_tb_synchronized = 1;
+	}
+	
 	for (i = 0; i < num_cpus; ++i)
 		cpu_set(i, cpu_possible_map);
 
#2 lore raw

ppc32 kernel, when built with CONFIG_SMP and booted on a single CPU machine, will not properly set smp_tb_synchronized, thus causing gettimeofday() to not use the HW timebase and to be limited to jiffy resolution. This, among others, causes unacceptable pauses when launching X.org.

---

With this patch, X.org startup time goes down from ~30 seconds to normal (just a second or so). The know-how really comes from BenH who I discussed with on IRC.

arch/ppc/kernel/smp.c +4 -0
@@ -301,6 +301,10 @@
 
 	/* Probe platform for CPUs: always linear. */
 	num_cpus = smp_ops->probe();
+	
+	if (num_cpus < 2)
+		smp_tb_synchronized = 1;
+	
 	for (i = 0; i < num_cpus; ++i)
 		cpu_set(i, cpu_possible_map);
 
#3 lore raw
Quoted 7 lines · Johannes Berg

ppc32 kernel, when built with CONFIG_SMP and booted on a single CPU machine, will not properly set smp_tb_synchronized, thus causing gettimeofday() to not use the HW timebase and to be limited to jiffy resolution. This, among others, causes unacceptable pauses when launching X.org.

Quoted 20 lines

---

With this patch, X.org startup time goes down from ~30 seconds to normal (just a second or so). The know-how really comes from BenH who I discussed with on IRC.

arch/ppc/kernel/smp.c +4 -0
@@ -301,6 +301,10 @@
 
 	/* Probe platform for CPUs: always linear. */
 	num_cpus = smp_ops->probe();
+	
+	if (num_cpus < 2)
+		smp_tb_synchronized = 1;
+	
 	for (i = 0; i < num_cpus; ++i)
 		cpu_set(i, cpu_possible_map);