- BogoMips
BogoMips (from "
bogus " and MIPS) is an unscientific measurement ofCPU speed made by theLinux kernel when it boots, to calibrate an internalbusy-loop .cite journal | first = Wim | last = Van Dorst | journal = Linux Journal | title = The Quintessential Linux Benchmark | month = January | year = 1996 | url = http://www.linuxjournal.com/article/1120 | accessdate = 2008-08-22] An oft-quoted definition of the term is "the number of million times per second a processor can do absolutely nothing."Eric S Raymond , andGeoff Mackenzie , published on theInternet in the early1990s , untraceable origin.] cite web | url = http://www.catb.org/jargon/html/B/BogoMIPS.html | first = Eric S. | last = Raymond | authorlink = Eric S Raymond | title = Hackers Jargon File]BogoMips can be used to see whether it is in the proper range for the particular processor, its clock frequency, and the potentially present
CPU cache . It is not usable for performance comparison between different CPUs.cite web | first = Wim | last = Van Dorst | url = http://www.clifton.nl/bogomips.html | title = BogoMips Mini-Howto | edition = V38 | date = 2 March 2006 | accessdate = 2008-08-22]Proper BogoMips ratings
As a very approximate guide, the BogoMips can be pre-calculated by the following table. The given rating is typical for that CPU with the then current and applicable
Linux version. The index is the ratio of "BogoMips per clock speed" for any CPU to the same for an Intel 386DX CPU, for comparison purposes.With the 2.2.14 Linux kernel, a caching setting of the CPU state was moved from behind to before the BogoMips calculation. Although the BogoMips algorithm itself wasn't changed, from that kernel onward the BogoMips rating for then current Pentium CPUs was twice that of the rating before the change. The changed BogoMips outcome had no effect on real processor performance.
How are BogoMIPS computed?
With current kernel (2.6.x), Bogomips are implemented in
/usr/src/linux/init/calibrate.c
kernel source file. It computesloops_per_jiffy
value. Explanation from source code:/* * A simple loop like * while ( jiffies < start_jiffies+1) * start = read_current_timer(); * will not do. As we don't really know whether jiffy switch * happened first or timer_value was read first. And some asynchronous * event can happen between these two events introducing errors in lpj. * * So, we do * 1. pre_start <- When we are sure that jiffy switch hasn't happened * 2. check jiffy switch * 3. start <- timer value before or after jiffy switch * 4. post_start <- When we are sure that jiffy switch has happened * * Note, we don't know anything about order of 2 and 3. * Now, by looking at post_start and pre_start difference, we can * check whether any asynchronous event happened or not */ loops_per_jiffy
is used to implementudelay
(delay in microseconds) and
ndelay
(delay in nanoseconds) functions. These functions are needed by some drivers to wait for hardware. Note that abusy waiting technique is used, so the kernel is effectively blocked when executingndelay/udelay
functions. For i386 architecturedelay_loop
is implemented in/usr/src/linux/arch/i386/lib/delay.c
as:which can be rewritten to C-pseudocode
Full and complete information and details about BogoMips, and hundreds of reference entries can be found in the (unfortunately outdated) BogoMips mini-Howto below.
References
External links
* [http://www.clifton.nl/bogomips.html BogoMips Mini-Howto, V38]
This article includes material from the
Free On-line Dictionary of Computing , which is licensed under theGFDL .
Wikimedia Foundation. 2010.