fbpx
维基百科

BogoMips

BogoMips ("bogus"與MIPS,伪MIPS) 是一种衡量CPU速度的不科学方法。当计算机内核启动时,将执行一个计数循环。

对于特定的CPU,BogoMips可用来查看它是否个合适的值。它的时钟频率和它潜在的CPU缓存。但是它不可在不同的CPU间进行比较演示。[1]

合适的BogoMips比率 编辑

作为一个参考向导,BogoMips可以用下列的表格进行预计算。给出的比率是以应用到LINUX版本的CPU作为例子。指数是指其它CPU同Intel 386DX CPU的BogoMips/clock speed比率.

CPU 比率 指数
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
ARM9 clock * 0.50 2.8
Motorola 8081 clock * 0.65 3.6
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
R4600 clock * 1.00 5.6
Hitachi SH-4 clock * 1.00 5.6
Intel Itanium 2 clock * 1.49 8.3
Alpha 21264 clock * 1.99 11.1
VIA Centaur clock * 1.99 11.1
AMD K5/K6/K6-2/K6-III clock * 2.00 11.1
AMD Duron/Athlon XP clock * 2.00 11.1
AMD Sempron clock * 2.00 11.1
UltraSparc II clock * 2.00 11.1
Intel Pentium MMX clock * 2.00 11.1
Intel Pentium 4 clock * 2.00 11.1
Intel Pentium M clock * 2.00 11.1
Intel Core Duo clock * 2.00 11.1
Intel Core 2 Duo clock * 2.00 11.1
Intel Atom N455 clock * 2.00 11.1
Centaur C6-2 clock * 2.00 11.1
PowerPC 604/604e/750 clock * 2.00 11.1
Intel Pentium III Coppermine clock * 2.00 11.1
Intel Pentium III Xeon clock * 2.00 11.1
Motorola 68060 clock * 2.01 11.2
Intel Xeon MP (32-bit) (hyper-threading) clock * 3.97 22.1
IBM S390 not enough data (yet)
ARM not enough data (yet)

BogoMIPS 怎么计算的? 编辑

在当前内核(2.6.x),BogoMIPS实现在内核源文件/usr/src/linux/init/calibrate.c。它计算了Linux内核定时参数loops_per_jiffy (see Jiffy英语Jiffy (time) ) 值。源码解释如下:

 /* * 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) {  int d0;  __asm__ __volatile__(  "\tjmp 1f\n"  ".align 16\n"  "1:\tjmp 2f\n"  ".align 16\n"  "2:\tdecl %0\n\tjns 2b"  :"=&a" (d0)  :"0" (loops)); } 

用C语言重写的代码如下:

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

关于BogoMips更丰富更全的信息和数百篇相关文章可参见 BogoMips mini-Howto.[1]

参考 编辑

  1. ^ 1.0 1.1 Van Dorst, Wim. BogoMips Mini-Howto V38. 2 March 2006 [2008-08-22]. (原始内容存档于2013-08-27). 

外部链接 编辑

bogomips, 此條目翻譯品質不佳, 2023年6月28日, 翻譯者可能不熟悉中文或原文語言, 也可能使用了機器翻譯, 請協助翻譯本條目或重新編寫, 并注意避免翻译腔的问题, 明顯拙劣的翻譯請改掛, href, template, html, class, redirect, title, template, href, wikipedia, html, class, redirect, title, wikipedia, 提交刪除, 此條目可参照英語維基百科相應條目来扩充, 2023年6月28日, 若您熟悉来. 此條目翻譯品質不佳 2023年6月28日 翻譯者可能不熟悉中文或原文語言 也可能使用了機器翻譯 請協助翻譯本條目或重新編寫 并注意避免翻译腔的问题 明顯拙劣的翻譯請改掛 a href Template D html class mw redirect title Template D d a a href Wikipedia CSD html G13 class mw redirect title Wikipedia CSD G13 a 提交刪除 此條目可参照英語維基百科相應條目来扩充 2023年6月28日 若您熟悉来源语言和主题 请协助参考外语维基百科扩充条目 请勿直接提交机械翻译 也不要翻译不可靠 低品质内容 依版权协议 译文需在编辑摘要注明来源 或于讨论页顶部标记 a href Template Translated page html title Template Translated page Translated page a 标签 BogoMips bogus 與MIPS 伪MIPS 是一种衡量CPU速度的不科学方法 当计算机内核启动时 将执行一个计数循环 对于特定的CPU BogoMips可用来查看它是否个合适的值 它的时钟频率和它潜在的CPU缓存 但是它不可在不同的CPU间进行比较演示 1 目录 1 合适的BogoMips比率 2 BogoMIPS 怎么计算的 3 参考 4 外部链接合适的BogoMips比率 编辑作为一个参考向导 BogoMips可以用下列的表格进行预计算 给出的比率是以应用到LINUX版本的CPU作为例子 指数是指其它CPU同Intel 386DX CPU的BogoMips clock speed比率 CPU 比率 指数Intel 8088 clock 0 004 0 02Intel AMD 386SX clock 0 14 0 8Intel AMD 386DX clock 0 18 1 definition Motorola 68030 clock 0 25 1 4Cyrix IBM 486 clock 0 34 1 8Intel Pentium clock 0 40 2 2Intel 486 clock 0 50 2 8AMD 5x86 clock 0 50 2 8MIPS R4000 R4400 clock 0 50 2 8ARM9 clock 0 50 2 8Motorola 8081 clock 0 65 3 6Motorola 68040 clock 0 67 3 7PowerPC 603 clock 0 67 3 7Intel StrongARM clock 0 66 3 7NexGen Nx586 clock 0 75 4 2PowerPC 601 clock 0 84 4 7Alpha 21064 21064A clock 0 99 5 5Alpha 21066 21066A clock 0 99 5 5Alpha 21164 21164A clock 0 99 5 5Intel Pentium Pro clock 0 99 5 5Cyrix 5x86 6x86 clock 1 00 5 6Intel Pentium II III clock 1 00 5 6AMD K7 Athlon clock 1 00 5 6Intel Celeron clock 1 00 5 6Intel Itanium clock 1 00 5 6R4600 clock 1 00 5 6Hitachi SH 4 clock 1 00 5 6Intel Itanium 2 clock 1 49 8 3Alpha 21264 clock 1 99 11 1VIA Centaur clock 1 99 11 1AMD K5 K6 K6 2 K6 III clock 2 00 11 1AMD Duron Athlon XP clock 2 00 11 1AMD Sempron clock 2 00 11 1UltraSparc II clock 2 00 11 1Intel Pentium MMX clock 2 00 11 1Intel Pentium 4 clock 2 00 11 1Intel Pentium M clock 2 00 11 1Intel Core Duo clock 2 00 11 1Intel Core 2 Duo clock 2 00 11 1Intel Atom N455 clock 2 00 11 1Centaur C6 2 clock 2 00 11 1PowerPC 604 604e 750 clock 2 00 11 1Intel Pentium III Coppermine clock 2 00 11 1Intel Pentium III Xeon clock 2 00 11 1Motorola 68060 clock 2 01 11 2Intel Xeon MP 32 bit hyper threading clock 3 97 22 1IBM S390 not enough data yet ARM not enough data yet BogoMIPS 怎么计算的 编辑在当前内核 2 6 x BogoMIPS实现在内核源文件 usr src linux init calibrate c 它计算了Linux内核定时参数loops per jiffy see Jiffy 英语 Jiffy time 值 源码解释如下 A simple loop like while jiffies lt 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 lt When we are sure that jiffy switch hasn t happened 2 check jiffy switch 3 start lt timer value before or after jiffy switch 4 post start lt 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 int d0 asm volatile t jmp 1f n align 16 n 1 t jmp 2f n align 16 n 2 t decl 0 n t jns 2b amp a d0 0 loops 用C语言重写的代码如下 static void delay loop long loops long d0 loops do d0 while d0 gt 0 关于BogoMips更丰富更全的信息和数百篇相关文章可参见 BogoMips mini Howto 1 参考 编辑 1 0 1 1 Van Dorst Wim BogoMips Mini Howto V38 2 March 2006 2008 08 22 原始内容存档于2013 08 27 外部链接 编辑BogoMips Mini Howto V38 页面存档备份 存于互联网档案馆 取自 https zh wikipedia org w index php title BogoMips amp oldid 77858293, 维基百科,wiki,书籍,书籍,图书馆,

文章

,阅读,下载,免费,免费下载,mp3,视频,mp4,3gp, jpg,jpeg,gif,png,图片,音乐,歌曲,电影,书籍,游戏,游戏。