All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] - Speed up boot - skip unnecessary clock calibration
@ 2007-03-27 13:29 Jack Steiner
  2007-03-27 17:53 ` Matthew Wilcox
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Jack Steiner @ 2007-03-27 13:29 UTC (permalink / raw)
  To: linux-ia64

Skip clock calibration if cpu being brought online is exactly the same
speed, stepping, etc., as the previous cpu. This significantly reduces
the time to boot very large systems. 

	Signed-off-by: Jack Steiner <steiner@sgi.com>


Index: linux/arch/ia64/kernel/smpboot.c
=================================--- linux.orig/arch/ia64/kernel/smpboot.c	2007-03-26 15:04:29.322256475 -0500
+++ linux/arch/ia64/kernel/smpboot.c	2007-03-27 08:26:41.914042190 -0500
@@ -424,7 +424,19 @@ smp_callin (void)
 	 * Get our bogomips.
 	 */
 	ia64_init_itm();
-	calibrate_delay();
+
+	/*
+	 * Delay calibration can be skipped if new processor is identical to the
+	 * previous processor.
+	 */
+	if (local_cpu_data->itc_freq != per_cpu(cpu_info, cpuid - 1).itc_freq ||
+			local_cpu_data->proc_freq != per_cpu(cpu_info, cpuid - 1).proc_freq ||
+	    		local_cpu_data->features != per_cpu(cpu_info, cpuid - 1).features ||
+	    		local_cpu_data->revision != per_cpu(cpu_info, cpuid - 1).revision ||
+	    		local_cpu_data->family != per_cpu(cpu_info, cpuid - 1).family ||
+	    		local_cpu_data->archrev != per_cpu(cpu_info, cpuid - 1).archrev ||
+	    		local_cpu_data->model != per_cpu(cpu_info, cpuid - 1).model)
+		calibrate_delay();
 	local_cpu_data->loops_per_jiffy = loops_per_jiffy;
 
 #ifdef CONFIG_IA32_SUPPORT

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] - Speed up boot - skip unnecessary clock calibration
  2007-03-27 13:29 [PATCH] - Speed up boot - skip unnecessary clock calibration Jack Steiner
@ 2007-03-27 17:53 ` Matthew Wilcox
  2007-03-27 18:42 ` Luck, Tony
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Matthew Wilcox @ 2007-03-27 17:53 UTC (permalink / raw)
  To: linux-ia64

On Tue, Mar 27, 2007 at 08:29:54AM -0500, Jack Steiner wrote:
> +	if (local_cpu_data->itc_freq != per_cpu(cpu_info, cpuid - 1).itc_freq ||
> +			local_cpu_data->proc_freq != per_cpu(cpu_info, cpuid - 1).proc_freq ||
> +	    		local_cpu_data->features != per_cpu(cpu_info, cpuid - 1).features ||
> +	    		local_cpu_data->revision != per_cpu(cpu_info, cpuid - 1).revision ||
> +	    		local_cpu_data->family != per_cpu(cpu_info, cpuid - 1).family ||
> +	    		local_cpu_data->archrev != per_cpu(cpu_info, cpuid - 1).archrev ||
> +	    		local_cpu_data->model != per_cpu(cpu_info, cpuid - 1).model)
> +		calibrate_delay();

If you use a temporary variable, you improve speed a little, and you
don't exceed 80 columns:

+	struct cpuinfo_ia64 *last_cpu_info = cpu_data(cpuid - 1);
+	struct cpuinfo_ia64 *this_cpu_info = local_cpu_data;
+	if (last_cpu_info->itc_freq != this_cpu_info->itc_freq ||
+	    last_cpu_info->proc_freq != this_cpu_info->proc_freq ||
+	    last_cpu_info->features != this_cpu_info->features ||
+	    last_cpu_info->revision != this_cpu_info->revision ||
+	    last_cpu_info->family != this_cpu_info->family ||
+	    last_cpu_info->archrev != this_cpu_info->archrev ||
+	    last_cpu_info->model != this_cpu_info->model)
+		calibrate_delay();


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] - Speed up boot - skip unnecessary clock calibration
  2007-03-27 13:29 [PATCH] - Speed up boot - skip unnecessary clock calibration Jack Steiner
  2007-03-27 17:53 ` Matthew Wilcox
@ 2007-03-27 18:42 ` Luck, Tony
  2007-03-27 19:17 ` Yu, Fenghua
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Luck, Tony @ 2007-03-27 18:42 UTC (permalink / raw)
  To: linux-ia64

> Skip clock calibration if cpu being brought online is exactly the same
> speed, stepping, etc., as the previous cpu. This significantly reduces
> the time to boot very large systems. 

Do we scan through the cpus in a way that makes this really useful I.e.
pounding through the cpus on a node - which are likely to be the
same - before going on to the next node?  Just looking at the
previous cpu won't help as much if we scan "breadth-first".

-Tony

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] - Speed up boot - skip unnecessary clock calibration
  2007-03-27 13:29 [PATCH] - Speed up boot - skip unnecessary clock calibration Jack Steiner
  2007-03-27 17:53 ` Matthew Wilcox
  2007-03-27 18:42 ` Luck, Tony
@ 2007-03-27 19:17 ` Yu, Fenghua
  2007-03-27 19:22 ` Jack Steiner
  2007-03-27 19:30 ` Jack Steiner
  4 siblings, 0 replies; 6+ messages in thread
From: Yu, Fenghua @ 2007-03-27 19:17 UTC (permalink / raw)
  To: linux-ia64

>+	 */
>+	if (local_cpu_data->itc_freq != per_cpu(cpu_info, cpuid -
1).itc_freq >||
>+			local_cpu_data->proc_freq != per_cpu(cpu_info,
cpuid - >1).proc_freq ||

BSP (cupid=0) should always calibrate delay. Otherwise the patch won't
work.

if (cupid=0)
 calibrate_delay()
else
 your patch.

Thanks.

-Fenghua

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] - Speed up boot - skip unnecessary clock calibration
  2007-03-27 13:29 [PATCH] - Speed up boot - skip unnecessary clock calibration Jack Steiner
                   ` (2 preceding siblings ...)
  2007-03-27 19:17 ` Yu, Fenghua
@ 2007-03-27 19:22 ` Jack Steiner
  2007-03-27 19:30 ` Jack Steiner
  4 siblings, 0 replies; 6+ messages in thread
From: Jack Steiner @ 2007-03-27 19:22 UTC (permalink / raw)
  To: linux-ia64

On Tue, Mar 27, 2007 at 12:17:17PM -0700, Yu, Fenghua wrote:
> >+	 */
> >+	if (local_cpu_data->itc_freq != per_cpu(cpu_info, cpuid -
> 1).itc_freq >||
> >+			local_cpu_data->proc_freq != per_cpu(cpu_info,
> cpuid - >1).proc_freq ||
> 
> BSP (cupid=0) should always calibrate delay. Otherwise the patch won't
> work.

True, but the call to calibrate the delay on cpu 0 comes from a different
place. See the call in init/main.c.

The code in smp_callin() is only called for cpus 1, 2, ...


-- jack

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] - Speed up boot - skip unnecessary clock calibration
  2007-03-27 13:29 [PATCH] - Speed up boot - skip unnecessary clock calibration Jack Steiner
                   ` (3 preceding siblings ...)
  2007-03-27 19:22 ` Jack Steiner
@ 2007-03-27 19:30 ` Jack Steiner
  4 siblings, 0 replies; 6+ messages in thread
From: Jack Steiner @ 2007-03-27 19:30 UTC (permalink / raw)
  To: linux-ia64

Skip clock calibration if cpu being brought online is exactly the same
speed, stepping, etc., as the previous cpu. This significantly reduces
the time to boot very large systems. 

	Signed-off-by: Jack Steiner <steiner@sgi.com>

----
Add suggestion from Matthew Wilcox to use local variables to shorten lines.




Index: linux/arch/ia64/kernel/smpboot.c
=================================--- linux.orig/arch/ia64/kernel/smpboot.c	2007-03-27 10:08:13.664475719 -0500
+++ linux/arch/ia64/kernel/smpboot.c	2007-03-27 14:20:44.070836177 -0500
@@ -375,6 +375,7 @@ static void __devinit
 smp_callin (void)
 {
 	int cpuid, phys_id, itc_master;
+	struct cpuinfo_ia64 *last_cpuinfo, *this_cpuinfo;
 	extern void ia64_init_itm(void);
 	extern volatile int time_keeper_id;
 
@@ -424,7 +425,21 @@ smp_callin (void)
 	 * Get our bogomips.
 	 */
 	ia64_init_itm();
-	calibrate_delay();
+
+	/*
+	 * Delay calibration can be skipped if new processor is identical to the
+	 * previous processor.
+	 */
+	last_cpuinfo = cpu_data(cpuid - 1);
+	this_cpuinfo = local_cpu_data;
+	if (last_cpuinfo->itc_freq != this_cpuinfo->itc_freq ||
+	    last_cpuinfo->proc_freq != this_cpuinfo->proc_freq ||
+	    last_cpuinfo->features != this_cpuinfo->features ||
+	    last_cpuinfo->revision != this_cpuinfo->revision ||
+	    last_cpuinfo->family != this_cpuinfo->family ||
+	    last_cpuinfo->archrev != this_cpuinfo->archrev ||
+	    last_cpuinfo->model != this_cpuinfo->model)
+		calibrate_delay();
 	local_cpu_data->loops_per_jiffy = loops_per_jiffy;
 
 #ifdef CONFIG_IA32_SUPPORT

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-03-27 19:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-27 13:29 [PATCH] - Speed up boot - skip unnecessary clock calibration Jack Steiner
2007-03-27 17:53 ` Matthew Wilcox
2007-03-27 18:42 ` Luck, Tony
2007-03-27 19:17 ` Yu, Fenghua
2007-03-27 19:22 ` Jack Steiner
2007-03-27 19:30 ` Jack Steiner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.