On Thu, 2006-10-26 at 13:28 -0400, Alan Altmark wrote:
> On Thursday, 10/26/2006 at 09:52 AST, Richard Troth
> <[EMAIL PROTECTED]> wrote:
> > > Note the existence of "bogo" in the word -- for bogus.
> > > It's a useless number.
> >
> > He says, as if MIPS were not also a useless number.   :-)
>
> (yawn...scratch..scratch)  So, I'm curious.  Does that mean "bogomips"
> has, like, O(n**2) level of bogocity?  Kul.

After the BogoMips number has entertained us once again I'm inclined to
"fix" this stupid number. The only place where we use the result of the
bogomips calculation is in __spin_lock_debug(). Any number roughly in
the same range as the bogomips number will do for __spin_lock_debug().
For replacement we could use the cpu capability that is reported by the
store system information instruction in SYSIB 1.2.2. On our test system
it reports a cpu capability of 1456 (System z type 2094 model 738/S38).
The bogomips number is between ~3400 and ~4000 dependent on the phase of
the moon and the my caffeine-level. With the attached patch the same
number is report every time. Makes sense, doesn't it ?

--
blue skies,
  Martin.

Martin Schwidefsky
Linux for zSeries Development & Services
IBM Deutschland Entwicklung GmbH

"Reality continues to ruin my life." - Calvin.

--
Index: arch/s390/Kconfig
===================================================================
RCS file: /home/cvs/linux-2.5/arch/s390/Kconfig,v
retrieving revision 1.65
diff -u -r1.65 Kconfig
--- arch/s390/Kconfig   24 Oct 2006 12:04:11 -0000      1.65
+++ arch/s390/Kconfig   27 Oct 2006 13:41:49 -0000
@@ -26,10 +26,6 @@
        bool
        default y

-config GENERIC_CALIBRATE_DELAY
-       bool
-       default y
-
 mainmenu "Linux Kernel Configuration"

 config S390
Index: drivers/s390/sysinfo.c
===================================================================
RCS file: /home/cvs/linux-2.5/drivers/s390/sysinfo.c,v
retrieving revision 1.8
diff -u -r1.8 sysinfo.c
--- drivers/s390/sysinfo.c      20 Sep 2006 08:52:54 -0000      1.8
+++ drivers/s390/sysinfo.c      27 Oct 2006 13:41:49 -0000
@@ -9,6 +9,7 @@
 #include <linux/mm.h>
 #include <linux/proc_fs.h>
 #include <linux/init.h>
+#include <linux/delay.h>
 #include <asm/ebcdic.h>

 struct sysinfo_1_1_1 {
@@ -351,3 +352,26 @@

 __initcall(create_proc_sysinfo);

+/*
+ * calibrate the delay loop
+ */
+void __init calibrate_delay(void)
+{
+       struct sysinfo_1_2_2 *info = (void *) get_zeroed_page (GFP_KERNEL);
+       unsigned int capability;
+
+       if (stsi(info, 1, 2, 2) == -ENOSYS)
+               /*
+                * Really old machine without stsi block for basic
+                * cpu information. Report 42.0 bogomips.
+                */
+               capability = 42;
+       else
+               capability = info->capability;
+       loops_per_jiffy = capability * (500000/HZ);
+       free_page((unsigned long) info);
+       /* Print the good old Bogomips line .. */
+       printk(KERN_DEBUG "Calibrating delay loop (skipped)... "
+              "%lu.%02lu BogoMIPS preset\n", loops_per_jiffy/(500000/HZ),
+              (loops_per_jiffy/(5000/HZ)) % 100);
+}

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to