patch-2.1.55 linux/arch/i386/kernel/smp.c

Next file: linux/arch/i386/kernel/sys_i386.c
Previous file: linux/arch/i386/kernel/entry.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.54/linux/arch/i386/kernel/smp.c linux/arch/i386/kernel/smp.c
@@ -85,7 +85,7 @@
  *	5AP.	Remote read is never used
  *	9AP.	XXX NEED TO CHECK WE HANDLE THIS XXX
  *	10AP.	XXX NEED TO CHECK WE HANDLE THIS XXX
- *	11AP.	Linux read the APIC between writes to avoid this, as per
+ *	11AP.	Linux reads the APIC between writes to avoid this, as per
  *		the documentation. Make sure you preserve this as it affects
  *		the C stepping chips too.
  *
@@ -887,10 +887,14 @@
 
 	/*
 	 *	Initialize the logical to physical cpu number mapping
+	 *	and the per-CPU profiling counter/multiplier
 	 */
 
-	for (i = 0; i < NR_CPUS; i++)
+	for (i = 0; i < NR_CPUS; i++) {
 		cpu_number_map[i] = -1;
+		prof_counter[i] = 1;
+		prof_multiplier[i] = 1;
+	}
 
 	/*
 	 *	Setup boot CPU information
@@ -917,15 +921,8 @@
 	 *	of here now!
 	 */
 
-	if (!smp_found_config) {
-		/*
-		 * For SMP-simulation on one CPU to work, we must initialize these 
-		 * values for the single CPU here:
-                 */
-	        prof_counter[0] = prof_multiplier[0] = 1;
-
+	if (!smp_found_config)
 		return;
-        }
 
 	/*
 	 *	Map the local APIC into kernel space
@@ -1625,7 +1622,6 @@
 
 __initfunc(void setup_APIC_clock (void))
 {
-	int cpu = smp_processor_id();
 	unsigned long flags;
 
 	static volatile int calibration_lock;
@@ -1658,11 +1654,10 @@
 	}
 
 /*
- * Now set up the timer for real. Profiling multiplier is 1.
+ * Now set up the timer for real.
  */
-	setup_APIC_timer (calibration_result);
 
-	prof_counter[cpu] = prof_multiplier[cpu] = 1;
+	setup_APIC_timer (calibration_result);
 
 	/*
 	 * We ACK the APIC, just in case there is something pending.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov