请输入您要查询的百科知识:

 

词条 BogoMips
释义

  1. History

  2. Proper BogoMips ratings

  3. Computation of BogoMIPS

  4. Timer-based delays

  5. See also

  6. References

  7. External links

BogoMips (from "bogus" and MIPS) is an unscientific measurement of CPU speed made by the Linux kernel when it boots to calibrate an internal busy-loop.[1] An often-quoted definition of the term is "the number of million times per second a processor can do absolutely nothing".[2][3]

BogoMips is a value that can be used to verify whether the processor in question is in the proper range of similar processors, i.e. BogoMips represents a processor's clock frequency as well as the potentially present CPU cache. It is not usable for performance comparisons among different CPUs.[4][5]

History

In 1993, Lars Wirzenius posted an email message[6] explaining the reasons for its introduction in the Linux kernel on comp.os.linux:

[...]

MIPS is short for Millions of Instructions Per Second. It is a measure for the computation speed of a processor. 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).

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.

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 computer[’]s caches and turbo button work, and b) Linus loves to chuckle when he sees confused people on the news.

[...]

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.

SystemRatingIndex
Intel 8088 clock × 0.0040.02
Intel/AMD 386SX clock × 0.140.8
Intel/AMD 386DX clock × 0.181 (definition)
Motorola 68030clock × 0.251.4
Cyrix/IBM 486clock × 0.341.8
Intel Pentiumclock × 0.402.2
Intel 486 clock × 0.502.8
AMD 5x86clock × 0.502.8
MIPS R4000/R4400clock × 0.502.8
ARM9clock × 0.502.8
Motorola 68040clock × 0.673.7
PowerPC 603clock × 0.673.7
Intel StrongARMclock × 0.663.7
NexGen Nx586clock × 0.754.2
PowerPC 601clock × 0.844.7
Alpha 21064/21064Aclock × 0.995.5
Alpha 21066/21066Aclock × 0.995.5
Alpha 21164/21164Aclock × 0.995.5
Intel Pentium Proclock × 0.995.5
Cyrix 5x86/6x86 clock × 1.005.6
Intel Pentium II/IIIclock × 1.005.6
AMD K7/Athlonclock × 1.005.6
Intel Celeronclock × 1.005.6
Intel Itaniumclock × 1.005.6
R4600clock × 1.005.6
Hitachi SH-4clock × 1.005.6
Raspberry Pi (Model B)clock × 1.005.6
Intel Itanium 2clock × 1.498.3
Alpha 21264clock × 1.9911.1
VIA Centaurclock × 1.9911.1
AMD K5/K6/K6-2/K6-IIIclock × 2.0011.1
AMD Duron/Athlon XPclock × 2.0011.1
AMD Sempronclock × 2.0011.1
UltraSparc IIclock × 2.0011.1
Intel Pentium MMXclock × 2.0011.1
Intel Pentium 4clock × 2.0011.1
Intel Pentium Mclock × 2.0011.1
Intel Core Duoclock × 2.0011.1
Intel Core 2 Duoclock × 2.0011.1
Intel Atom N455clock × 2.0011.1
Centaur C6-2clock × 2.0011.1
PowerPC 604/604e/750clock × 2.0011.1
Intel Pentium III Coppermineclock × 2.0011.1
Intel Pentium III Xeonclock × 2.0011.1
Motorola 68060clock × 2.0011.1
Intel Xeon MP (32-bit) (hyper-threading)clock × 3.9722.1
IBM S390not enough data (yet)
ARMnot enough data (yet)

Source[7]

For a complete list, refer to the BogoMips mini-Howto.

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.

Linux command for visualization bogomips : $ cat /proc/cpuinfo

Computation of BogoMIPS

With kernel 2.6.x, BogoMIPS are implemented in the /usr/src/linux/init/calibrate.c kernel source file. It computes the Linux kernel timing parameter loops_per_jiffy (see jiffy) value. The 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 implement udelay (delay in microseconds) and ndelay (delay in nanoseconds) functions. These functions are needed by some drivers to wait for hardware. Note that a busy waiting technique is used, so the kernel is effectively blocked when executing ndelay/udelay functions. For i386 architecture delay_loop is implemented in /usr/src/linux/arch/i386/lib/delay.c as:

/* simple loop based delay: */

static void delay_loop(unsigned long loops)

{
  __asm__ __volatile__(    "\\tjmp 1f\"    ".align 16\"    "1:\\tjmp 2f\"    ".align 16\"    "2:\\tdecl %0\\\tjns 2b"    :"=&a" (d0)    :"0" (loops));

}

equivalent to the following assembler code

input
eax = d0
output
eax = 0

.align 16

start: jmp body

.align 16

body: decl eax

which can be rewritten to C-pseudocode

static void delay_loop(long loops)

{
  long d0 = loops;  do {    --d0;  } while (d0 >= 0);

}

Full and complete information and details about BogoMips, and hundreds of reference entries can be found in the (outdated) BogoMips mini-Howto.[4]

Timer-based delays

In 2012, ARM contributed a new udelay implementation allowing the system timer built into many ARMv7 CPUs to be used instead of a busy-wait loop. This implementation was released in Version 3.6 of the Linux kernel.[8] Timer-based delays are more robust on systems that use frequency scaling to dynamically adjust the processor's speed at runtime, as loops_per_jiffies values may not necessarily scale linearly. Also, since the timer frequency is known in advance, no calibration is needed at boot time.

One side effect of this change is that the BogoMIPS value will reflect the timer frequency, not the CPU's core frequency. Typically the timer frequency is much lower than the processor's maximum frequency, and some users may be surprised to see an unusually low BogoMIPS value when comparing against systems that use traditional busy-wait loops.

See also

  • Turbo button

References

1. ^{{cite journal | first = Wim | last = Van Dorst | journal = Linux Journal | title = The Quintessential Linux Benchmark |date=January 1996 | url = http://www.linuxjournal.com/article/1120 | accessdate = 2008-08-22}}
2. ^Eric S Raymond, and Geoff Mackenzie, published on the Internet in the early 1990s, untraceable origin.
3. ^{{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}}
4. ^{{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}}
5. ^{{cite web|last=Blidung|first=Thomas|title=Re: How many BogoMips should I expect from my 486DX2 running Linux?|url=https://groups.google.com/group/comp.os.linux.help/browse_thread/thread/5853976bc8851b04/7fbc3a800b981da0?hl=fr&ie=UTF-8#7fbc3a800b981da0}}
6. ^{{cite web|last=Wirzenius|first=Lars|title=Re: printing & BogoMips|url=https://groups.google.com/group/comp.os.linux/browse_thread/thread/589fc4eaa432f8b6/ea0df3ceaa8f129a?hl=fr&q=MIPS+is+short+for+Millions+of+Instructions#ea0df3ceaa8f129a}}
7. ^{{cite web|last=Bekman|first=Stas|title=What is a BogoMip?|url=http://stason.org/TULARC/os/linux-faq/019-What-is-a-BogoMip.html}}
8. ^{{cite web|title=ARM: 7452/1: delay: allow timer-based delay implementation to be selected|last=Deacon|first=Will|url=https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d0a533b18235d36206b9b422efadb7cee444dfdb}}

External links

  • BogoMips Mini-Howto, V38
  • {{FOLDOC}}
  • [https://github.com/vitalyvch/Bogo/tree/BogoMIPS_v1.3 Sources of classical standalone benchmark]
{{Benchmark}}

2 : Linux kernel|Benchmarks (computing)

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/12 10:23:15