Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Greg Weeks <greg.weeks@timesys.com>
Cc: Stuart Longland <stuartl@longlandclan.hopto.org>,
	linux-mips@linux-mips.org
Subject: Re: BogoMIPS
Date: Wed, 13 Apr 2005 14:21:18 +0100	[thread overview]
Message-ID: <20050413132118.GG5253@linux-mips.org> (raw)
In-Reply-To: <425D0448.6010700@timesys.com>

On Wed, Apr 13, 2005 at 07:36:40AM -0400, Greg Weeks wrote:

> >So honestly, I don't know what's happening with BogoMIPS. :-)  What I do
> >know however, it isn't worth a cracker in terms of benchmarking value. 
> >;-)
> 
> I could care less about it as a benchmarking value, but it's used to do 
> calibrated udelays.  If mips doesn't need it because it calibrates some 
> other way then fine. I suspect not though and we're probably using an 
> initial works everywhere value. I don't know though.

The bugs is the result of the somewhat messy way the calibration code is
working.  calibrate_delay() puts it's result into a global variable,
loops_per_jiffy.  The value is CPU-specific not global, so we need to
copy it to a per-processor data structure which we do on SMP but forget
to do on uniprocessor.  At the same time the actual delay loop code in
delay.h knew to use loops_per_jiffy on uniprocessor, so it was actually
working ok.

   Ralf

Index: arch/mips/kernel/cpu-probe.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/kernel/cpu-probe.c,v
retrieving revision 1.43
diff -u -r1.43 cpu-probe.c
--- arch/mips/kernel/cpu-probe.c	8 Apr 2005 20:36:05 -0000	1.43
+++ arch/mips/kernel/cpu-probe.c	13 Apr 2005 13:19:11 -0000
@@ -17,7 +17,6 @@
 #include <linux/ptrace.h>
 #include <linux/stddef.h>
 
-#include <asm/bugs.h>
 #include <asm/cpu.h>
 #include <asm/fpu.h>
 #include <asm/mipsregs.h>
Index: arch/mips/kernel/smp.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/kernel/smp.c,v
retrieving revision 1.77
diff -u -r1.77 smp.c
--- arch/mips/kernel/smp.c	18 Mar 2005 17:36:53 -0000	1.77
+++ arch/mips/kernel/smp.c	13 Apr 2005 13:19:11 -0000
@@ -226,7 +226,6 @@
 /* called from main before smp_init() */
 void __init smp_prepare_cpus(unsigned int max_cpus)
 {
-	cpu_data[0].udelay_val = loops_per_jiffy;
 	init_new_context(current, &init_mm);
 	current_thread_info()->cpu = 0;
 	smp_tune_scheduling();
Index: include/asm-mips/bugs.h
===================================================================
RCS file: /home/cvs/linux/include/asm-mips/bugs.h,v
retrieving revision 1.10
diff -u -r1.10 bugs.h
--- include/asm-mips/bugs.h	25 Jul 2003 22:49:24 -0000	1.10
+++ include/asm-mips/bugs.h	13 Apr 2005 13:19:12 -0000
@@ -8,12 +8,17 @@
 #define _ASM_BUGS_H
 
 #include <linux/config.h>
+#include <asm/cpu.h>
+#include <asm/cpu-info.h>
 
 extern void check_bugs32(void);
 extern void check_bugs64(void);
 
 static inline void check_bugs(void)
 {
+	unsigned int cpu = smp_processor_id();
+
+	cpu_data[cpu].udelay_val = loops_per_jiffy;
 	check_bugs32();
 #ifdef CONFIG_MIPS64
 	check_bugs64();
Index: include/asm-mips/delay.h
===================================================================
RCS file: /home/cvs/linux/include/asm-mips/delay.h,v
retrieving revision 1.16
diff -u -r1.16 delay.h
--- include/asm-mips/delay.h	8 Oct 2004 02:41:17 -0000	1.16
+++ include/asm-mips/delay.h	13 Apr 2005 13:19:12 -0000
@@ -15,8 +15,6 @@
 
 #include <asm/compiler.h>
 
-extern unsigned long loops_per_jiffy;
-
 static inline void __delay(unsigned long loops)
 {
 	if (sizeof(long) == 4)
@@ -82,11 +80,7 @@
 	__delay(usecs);
 }
 
-#ifdef CONFIG_SMP
 #define __udelay_val cpu_data[smp_processor_id()].udelay_val
-#else
-#define __udelay_val loops_per_jiffy
-#endif
 
 #define udelay(usecs) __udelay((usecs),__udelay_val)
 

  reply	other threads:[~2005-04-13 13:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-12 14:36 BogoMIPS Greg Weeks
2005-04-13  4:19 ` BogoMIPS Stuart Longland
2005-04-13 11:36   ` BogoMIPS Greg Weeks
2005-04-13 13:21     ` Ralf Baechle [this message]
2005-04-13 12:47   ` BogoMIPS Ralf Baechle
  -- strict thread matches above, loose matches on Subject: below --
1997-06-17 14:28 bogomips Mike Shaver
1997-06-06 11:35 bogomips Mike Shaver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050413132118.GG5253@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=greg.weeks@timesys.com \
    --cc=linux-mips@linux-mips.org \
    --cc=stuartl@longlandclan.hopto.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox