old-www/HOWTO/BogoMips/bogo-faq.html

699 lines
17 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>The frequently asked questions about BogoMips</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="BogoMips mini-Howto"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="The highest and lowest BogoMips ratings"
HREF="bogo-hilo.html"><LINK
REL="NEXT"
TITLE="Compilation of ratings"
HREF="bogo-list.html"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>BogoMips mini-Howto</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="bogo-hilo.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="bogo-list.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="AEN122"
></A
>3. The frequently asked questions about BogoMips</H1
><P
>Several authors have contributed to my knowledge of BogoMips. In
this place, I would like to thank them highly.</P
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN125"
></A
>3.1. What are BogoMips</H2
><P
>Quoted from the Internet, origin unknown but brought to the
attention by Eric S Raymond, <EM
>esr@thyrsus.com</EM
>,
and Geoff Mackenzie, <EM
>freon@dialstart.net</EM
>, there
is an humourously illustrative definition of BogoMips as ''the
number of million times per second a processor can do absolutely
nothing.''</P
><P
>On a more precise basis, from mail from Lars Wirzenius,
<EM
>wirzeniu@kruuna.Helsinki.FI</EM
>, dated 9 September
1993, explaining BogoMips, with additional detailed information by
Alessandro Rubini, <EM
>rubini@morgana.systemy.it</EM
>,
and by howto-author Wim van Dorst:</P
><P
><A
NAME="AEN134"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><P
>`MIPS is short for Millions of Instructions
Per Second. It is a measure for the computation speed of a program.
Like most such measures, it is more often abused than used properly
(it is very difficult to justly compare MIPS for different kinds
of computers).</P
><P
>BogoMips are Linus's own invention. The linux kernel version
0.99.11 (dated 11 July 1993) needed a timing loop (the time is
too short and/or needs to be too exact for a non-busy-loop method
of waiting), which must be calibrated to the processor speed of the
machine. Hence, the kernel measures at boot time how fast a certain
kind of busy loop runs on a computer. "Bogo" comes from "bogus",
i.e, something which is a fake. Hence, the BogoMips value gives some
indication of the processor speed, but it is way too unscientific to
be called anything but BogoMips.</P
><P
>The reasons (there are two) it is printed during boot-up is
that a) it is slightly useful for debugging and for checking that
the computers caches and turbo button work, and b) Linus loves to
chuckle when he sees confused people on the
news.'</P
></BLOCKQUOTE
></P
><P
>BogoMips are being determined in
<TT
CLASS="filename"
>/usr/src/linux/init/main.c</TT
> (simple C
algorithm, with a nice example of floating point arithmetic
within the fully integer kernel), and the pertaining
kernel variable <EM
>loops_per_sec</EM
> is
used in several drivers for more serious purpose. The
actual delay function <TT
CLASS="filename"
>udelay()</TT
> is in
assembler, and therefore each port has its own definition
in <TT
CLASS="filename"
>/include/asm/delay.h</TT
>. The
<EM
>loops_per_sec</EM
> variable and the
<TT
CLASS="filename"
>udelay()</TT
> function are used in numerous drivers,
see:</P
><P
><A
NAME="AEN146"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;cd /usr/src/linux #or where else source is located
find . -name '*.[hcS]' -exec fgrep loops_per_sec {} /dev/null \;
find . -name '*.[hcS]' -exec fgrep udelay {} /dev/null \;
</PRE
></FONT
></TD
></TR
></TABLE
></BLOCKQUOTE
></P
><P
>The BogoMips calculation loop for the non Intel CPUs is similar
but not the same, because it is programmed in another assembler
language. BogoMips is however the only portable way over the various
CPUs (Intel-type and non Intel-type) for getting an indication of the
CPU speed. Even CPU clock speed is not available on all CPUs. </P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN149"
></A
>3.2. How to estimate what the proper BogoMips rating should be</H2
><P
>From a initiative by Ian Jackson,
<EM
>ijackson@nyx.cs.du.edu</EM
>, and Przemek Klosowski,
then with just three or four entries, much updated and expanded by
howto-author Wim van Dorst for current data, as listed below:</P
><P
>As a very approximate guide, the BogoMips can be calculated by:</P
><P
><A
NAME="AEN155"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;System BogoMips Comparison
Intel 8088 clock * 0.004 0.02
Intel/AMD 386SX clock * 0.14 0.8
Intel/AMD 386DX clock * 0.18 1 (definition)
Motorola 68030 clock * 0.25 1.4
Cyrix/IBM 486 clock * 0.34 1.8
Intel Pentium clock * 0.40 2.2
Intel 486 clock * 0.50 2.8
AMD 5x86 clock * 0.50 2.8
Mips R4000/R4400 clock * 0.50 2.8
Motorola 68040 clock * 0.67 3.7
PowerPC 603 clock * 0.67 3.7
Intel StrongArm clock * 0.66 3.7
Nexgen Nx586 clock * 0.75 4.2
PowerPC 601 clock * 0.84 4.7
Alpha 21064/21064A clock * 0.99 5.5
Alpha 21066/21066A clock * 0.99 5.5
Alpha 21164/21164A clock * 0.99 5.5
Intel Pentium Pro clock * 0.99 5.5
Cyrix 5x86/6x86 clock * 1.00 5.6
Intel Pentium II/III clock * 1.00 5.6
AMD K7/Athlon clock * 1.00 5.6
Intel Celeron clock * 1.00 5.6
Intel Itanium clock * 1.00 5.6
Mips R4600 clock * 1.00 5.6
Intel Itanium 2 clock * 1.49 8.3
Alpha 21264 clock * 1.99 11.1
Centaur VIA clock * 1.99 11.1
AMD K5/K6/K6-2/K6-III clock * 2.00 11.1
AMD Athlon XP/Athlon 64 clock * 2.00 11.1
AMD Duron/Opteron clock * 2.00 11.1
UltraSparc II clock * 2.00 11.1
Pentium MMX clock * 2.00 11.1
Pentium 4 clock * 2.00 11.1
Centaur C6-2 clock * 2.00 11.1
PowerPC 604/604e/750 clock * 2.00 11.1
Motorola 68060 clock * 2.01 11.2
Intel Xeon (hyperthreading) clock * 3.97 22.1
Hitachi SH-4 not enough data (yet)
IBM S390 not enough data (yet)
Intel ARM not enough data (yet)
</PRE
></FONT
></TD
></TR
></TABLE
></BLOCKQUOTE
></P
><P
>Note that the BogoMips calculation loop does not take full
advantage of the parallelism of various processors, such
as the Intel Pentium and the Alpha 21164. Also read the
section on 'New BogoMips algorithm?' below, since for some
of these CPUs recent kernels may give different data.</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN158"
></A
>3.3. How to determine what the current BogoMips rating is</H2
><P
>There are three methods to determine the current BogoMips, viz.</P
><P
><P
></P
><OL
TYPE="1"
><LI
><P
>looking in <EM
>/proc/cpuinfo</EM
>, e.g., with
<EM
>`cat /proc/cpuinfo`</EM
>. This method is highly
preferred above the alternatives.</P
></LI
><LI
><P
>looking in the syslog output to see what was printed there
during booting. If you're lucky the information may still be on
the booting virtual console (if necessary, switch to it with the
Alt-F1 key combination), otherwise you can retrieve the information
explicitly with dmesg or syslogk. This alternative gives accurate
information but is more work.</P
></LI
><LI
><P
>using the standalone bogomips program. This is only recommended
for non-Linux system, for reasons pointed out below. </P
></LI
></OL
></P
><P
>A non-determinative alternative, which is also
applicable for non-Linux systems such as Crays, Palm PDAs,
DOS, and similar, may be a standalone BogoMips program. Some
versions are currently available, viz., by Darrick Wong,
<EM
>djwong@thibs.menloschool.org</EM
>, and by Philip
Snowdon, <EM
>philips@users.sf.net</EM
>. Jeff Tranter,
<EM
>jeff_tranter@mitel.com</EM
> was the original
author. From his readme file:</P
><P
><A
NAME="AEN176"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><P
>`Tired of rebooting your system so you can
see how many BogoMips it's running at today? [...] "Bogomips" is a
standalone program that displays your system performance using one
of the world's most recognized benchmarks. It uses the same code
that is used in the Linux kernel while booting, but runs as a user
program. [...] Version 1.3 of BogoMips is now portable and should run
on any system that supports an ANSI C compiler and
library.'</P
></BLOCKQUOTE
></P
><P
>Note that due to system load values calculated with a standalone
program on Linux systems may be quite different from registered
in the list below. Intrinsically a standalone program cannot give
precisely similar information to the boot sequence BogoMips, since
system load will compete with the program run by an ordinary user.
Therefore only boot sequence BogoMips ratings are listed below.</P
><P
>Be aware that Jeff's original file on
<TT
CLASS="filename"
>sunsite.unc.edu</TT
>, named
<TT
CLASS="filename"
>/pub/Linux/system/status/bogo-1.2.tar.gz</TT
>,
internally designated version 1.3,
is rather outdated. Therefore, check out Darrick's program on
<TT
CLASS="filename"
>http://thibs.menloschool.org/~djwong/programs/bogomips/</TT
>,
if still reachable. He even has a MSW*nd*ws binary version. And
very interestingly, Phil Snowdon has developed the PalmOS version,
to be found at <TT
CLASS="filename"
>http://bogomips.sourceforge.net</TT
>.
</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN184"
></A
>3.4. Variations in BogoMips rating</H2
><P
>From Linus Torvalds,
<EM
>torvalds@cc.helsinki.fi</EM
>, explaining about the
variation one may see in the BogoMips rating, in c.o.l.development,
at 28 April 1994</P
><P
><A
NAME="AEN189"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><P
>`The BogoMips calculation loop is
"quantizised", so you're most likely to get the exact same number
all the time. You usually will get different numbers only if the
speed is just on the "edge", when small variations (different time
for interrupt ticks etc) will make it jump from one value to the
other.'</P
></BLOCKQUOTE
></P
><P
>If a kernel is not compiled specifically for the pertaining CPU,
also some (even large) variations of the BogoMips ratings can occur,
mainly due to erroneous alignment. This problem apparently only occurs
on the various x86 CPUs (Intel and clones). Fortunately it can easily
be solved: recompile the kernel specifically for your CPU.</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN192"
></A
>3.5. New BogoMips algorithm?</H2
><P
>No, the BogoMips algorithm, contrarily to popular believe, did
NOT change over the various kernel versions. Furthermore, it is
intrinsically the same for all CPUs of all makes.</P
><P
>What did change from kernel version 2.2.13 to 2.2.14 is the CPU state
setting just before the BogoMips calculation. This affects the
BogoMips rating for all Intel and AMD Pentium variations, resulting
in approximately 2*clock, if they were not 2*clock already.</P
><P
>The entries based on these upgraded kernel versions for CPUs
where this change was actually relevant for (Pentium II/III,
Celeron, Athlon) are marked in the list below with an initial *
(star symbol).</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN197"
></A
>3.6. BogoMips ... failed</H2
><P
>Suggested by various questions on the net and private mail,
e.g., by Lily, <EM
>lbliao@alumni.caltech.edu</EM
>, and by
Pierre Frenkiel, <EM
>frenkiel@cdfap2.in2p3.fr</EM
>. In
March 1995 they asked:</P
><P
><A
NAME="AEN203"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><P
>`When I boot Linux I get the message:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13; Calibrating delay loop.. ok - 23.96 BogoMips
failed
</PRE
></FONT
></TD
></TR
></TABLE
>
Where/why has the calibration delay loop failed?'</P
></BLOCKQUOTE
></P
><P
>It didn't fail. If it had failed the text would have been
<A
NAME="AEN207"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13; Calibrating delay loop.. failed
</PRE
></FONT
></TD
></TR
></TABLE
></BLOCKQUOTE
></P
><P
>What likely did fail was a driver for some gadget which you
may not have in your machine. Just after calculating the BogoMips
rating all device drivers are initiated. First the SCSI devices,
then Net devices, etc. Any failure is duly reported. Noteworthy
is the AHA152x driver. Other effects of failing drivers (and not of
failing BogoMips calculations) are systems crashes, long waits, and
complete system locks, somewhere close to (just before or just after)
outputting the ok - xx.xx BogoMips text.</P
><P
>Since Linux 1.2 many error messages have improved, so upgrade
to at least that version to find out which particular driver it is
that is failing. Also recompile the kernel to only include the drivers
that are actually needed for your hardware configuration.</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN211"
></A
>3.7. What about clone CPUs (Cyrix, NexGen, AMD, etc)</H2
><P
>Cyrix 486-like CPUs need cache enabling software, sometimes
referred to as BogoBoost software. Cyrix 5x86 and 6x86 CPUs may
have their BogoMips improved drastically by branch-prediction (BIOS
option). Note that the performance improvement may be marginal. There
are several packages available for adjusting Cyrix CPUs, such as the
BogoBoost patch, cx5x86mod, and set6x86, all from the normal archives,
in obvious places. It is reported the Cyrix 6x86 CPUs may give
better performance when the kernel is compiled with 486-optimization,
instead Pentium-optimization.</P
><P
>NexGen 386-enhanced CPUs, marked as Nx586, are listed as
386-like, since the fact that they are performing like Pentium machines
is not relevant to BogoMips.</P
><P
>AMD 5x86, also denoted as AMD 486DX5, are quadrupled 486/33
machines. They are fully in line with other 486 CPUs. The AMD
K5 and the K6 are Pentium-like CPUs, with their own BogoMips
multipliers.</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN216"
></A
>3.8. Why to pay attention to BogoMips</H2
><P
>Let me add that there are only two reasons for paying attention
to the BogoMips rating that is presented on booting Linux:</P
><P
><P
></P
><OL
TYPE="1"
><LI
><P
>To see whether it is in the proper range for the particular
processor, its clock frequency, and the potentially present cache.
Many CPUs are prone to faulty setups of
<P
></P
><UL
><LI
><P
>memory cache setting (write-back is wrong for BogoMips,
often reported lower than 5; write-through is ok)</P
></LI
><LI
><P
>turbo-buttons (should be ON)</P
></LI
><LI
><P
>BIOS-software emulated fake cache (change it for real
cache)</P
></LI
><LI
><P
>similar cache and clock related things, sometimes
also BIOS-software related</P
></LI
></UL
>
</P
></LI
><LI
><P
>To see whether your system is faster than mine. Of
course this is completely wrong, unreliable, ill-founded, and utterly
useless, but all benchmarks suffer from this same problem. So why not
use it? This inherent stupidity has never before stopped people from
using benchmarks, has it? :-) </P
><P
><EM
>Note of the author: this remark was made somewhere in
the mid nineties when comparing high BogoMips rates for some
low-capacity CPUs with high clockrates (e.g., 486) to rates for
CPUs with lower clock rates but much more capacity (e.g., Pentiums).
</EM
></P
></LI
></OL
></P
><P
>More serious uses for real benchmarking are addressed
in the Linux Benchmarking Howto by Andre D. Balsa.</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="bogo-hilo.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="bogo-list.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>The highest and lowest BogoMips ratings</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Compilation of ratings</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>