The Quintessential Linux Benchmark

When Linux boots, it displays a “BogoMips” number. What does that mean? Is the number displayed correct? What use is the infromation? This quintessential part of Linux is demystified in this article.

Some device drivers in the Linux kernel need timing delays. Either they need a very short delay, or the delay must be very accurately determined. A simple non-busy loop cannot do this. Therefore, Linus Torvalds added a calibration in the boot procedure to predetermine how often a specific busy-loop algorithm can be calculated in one second. This predetermined value, called loops_per_second, is used in the device drivers to delay for precisely measured times.

For fun, Linus also added a print statement presenting this predetermined value (divided by 500,000) as BogoMips. Linus apparently loves it when millions of Linux users are gazing at their computer, baffled by these bogus MIPS. Note that BogoMips have nothing to do with the million instructions per second that the name suggests; that is why they are bogus.

The only serious reason for paying attention to the BogoMips presented on booting Linux is to see whether it is in the proper range for the particular processor, its clock frequency, and the potentially present cache. 486 systems are especially prone to faulty setups of RAM caching, turbo-buttons, and such things.

Which Value to Expect

People continuously ask on Usenet: “I have an XYZ CPU running at clock MHz. How many BogoMips should it do?” The answer can be calculated from the following table:

Intel/AMD 386SX    clock * 0.14 (± 0.01)
Intel/AMD 386DX    clock * 0.18 (± 0.01)
Cyrix/IBM 486      clock * 0.33 (± 0.04)
Intel/AMD 486      clock * 0.50 (± 0.01)
Pentium            clock * 0.40 (± 0.01)
680x0              (insufficient data)
PowerPC            clock * 0.77 (± 0.02)
Mips               (insufficient data)
Alpha              clock * 0.99 (± 0.01)

From the above calculation we see several important points. First of all, the Intel and AMD 486 CPUs are not showing the same BogoMips as Cyrix and IBM 486 CPUs. This does not mean that they have a different perceived performance; it just means that they process the busy-loop algorithm differently.

The table also shows that the Pentium processor doesn't have the expected extrapolated multiplication factor. This is due to the fact that the specific busy-loop algorithm is not optimized for the parallelism of the Pentium processor.

The BogoMips calculations for the Motorola, PowerPC, Mips, and Alpha processors are similar to the Intel type processors calculations. Because the non-busy loop algorithm is coded in Assembler, however, they cannot be identical. It clearly shows that comparison of BogoMips between CPUs is really bogus, even between two different Intel type CPUs.

Last but not least, you see an allowed variation in the multiplication factor of about 0.01. The BogoMips calculation loop is “quantizised” (Linus's term), so it is likely that you will get exactly the same number all the time. Yet, if the speed is just on the edge, small variations, such as different lengths for interrupts, will cause your machine's BogoMips to vary.

The Most Frequently Asked Question

“When I boot Linux I get the message:

Calibrating delay loop.. ok - 23.96 BogoMips
failed

Where or why has the calibration delay loop failed?”

The obvious answer is that it didn't fail. If it had failed the text would have been:

Calibrating delay loop.. failed

What likely did fail was a driver for some gadget which may not be in the machine. The point is that just after calculating the BogoMips, all device drivers are initialized: first the SCSI devices, then Net devices, etc. Any failure in these initializations is duly reported. The AHA152x drive is noted for such failures. Other effects of failing drivers (and not of failing BogoMips calculations) are systems crashes, long waits, and complete system lock-ups.

Since Linux 1.2, many error messages have improved, so upgrade to at least that version to find out which particular driver is failing.

Standalone BogoMips Program

For people without Linux systems, or for those people who do not want to reboot their system time and again, a stand-alone program for calculating BogoMips is available in the standard archives (e.g., on sunsite.unc.edu in /pub/Linux/system/Status/bogo-1.2.tar.gz). On Linux, by default, it runs the same code that is used in the Linux kernel while booting, but runs as a user program. Note that due to system load, values calculated with the stand-alone program may be lower than expected for the CPU you are running, and lower than reported during boot. For the non-Linux systems, a portable C version is available that may run on any system that supports an ANSI C compiler and library.

______________________

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState