cpu

Table of Contents

1 超线程,双核和双路CPU

1.1 超线程

超线程(Hyperthreading Technology)技术就是通过采用特殊的硬件指令,可以把两个逻辑内核模拟成两个物理芯片,在单处理器中实现线程级的并行计算,同时在相应的软硬件的支持下大幅度的提高运行效能,从而实现在单处理器上模拟双处理器的效能。其实,从实质上说,超线程是一种可以将CPU内部暂时闲置处理资源充分“调动” 起来的技术。“超线程”的实现条件需要CPU的支持,主板芯片组和主板BIOS的支持,另外操作系统和应用软件方面也需得到应有的支持。说白了超线程就是通过软件的手段模拟出双个逻辑内核进行工作,运行效果尽量接近两个物理核心的性能。不过超线程也存在着致命的不足,首先他在windows 2000下无法使用,因为WIN2000不支持超线程,只有WIN XP以上的系统才可以使用HT。另外由于HT是软件模拟出两个核心,所以模拟出来后的两个核心是分享物理缓存的,从而使物理缓存大小减半,另外因为超线程技术是对多任务处理有优势,因此当运行单线程运用软件时,超线程技术将会降低系统性能,尤其在多线程操作系统运行单线程软件时将容易出现此问题。

1.2 双核心

所谓双核心处理器,简单地说就是在一块CPU基板上集成两个处理器核心,并通过并行总线将各处理器核心连接起来。双核心并不是一个新概念,而只是CMP(Chip Multi Processors ,单芯片多处理器) 中最基本、最简单、最容易实现的一种类型。换言之双核心处理器就是基于单个半导体的一个处理器上拥有两个一样功能的处理器核心。这样就将两个物理处理器核心整合入一个核中,在任务繁重时,两个核心能相互配合,让CPU发挥最大效力。两个能互补的核心运行起来性能是非常不错的,例如使用Intel奔腾D双核处理器就相当于你有了两台采用奔腾4的主机。如果说超线程是用软件来模拟出双核的效果,那么现在所说的双核心就是真正意义上的两个核心。他弥补了超线程适用系统比较少的缺点,可以广泛用于windows操作系统的多个版本;他还有效的解决了双核运算中出现的缓存分离与数据冲突错误问题。

1.3 双CPU(双路CPU)

前面所说的双核心是在一个处理器里拥有两个处理器核心,核心是两个,但是其他硬件还都是两个核心在共同拥有,而双CPU则是真正意义上的双核心,不光是处理器核心是两个,其他例如缓存等硬件配置也都是双份的。

1.4 总结

单处理器内部有很多资源是不会同时使用的,比如浮点逻辑单元FPU与算术逻辑单元ALU。如果线程里面线程A在进行浮点运算,而线程B在进行整数运算的话,两个线程使用超线程技术同时运行,就可以充分利用单处理器的资源了。按照编程术语来说的话,超线程称为并发(Concurrency). 双核心是有两个处理器核心,两份FPU以及ALU以及CU(Control Unit),在真正执行起来的话也是两个处理器都同时执行。但是它们共享一个缓存,使用同一条总线访问内存,而在这个时候需要串行访问。按照编程术语来说的话,双核称为带有局部冲突的并行(Parallelisim with local contention). 双路CPU就是真正的两个处理器核心以及核心外围设施都相互独立。同样按照编程术语来说的话,双路称为无冲突并行(Parallelism without contention).

2 x86 Faces Unexpected RISC Competition

http://www.drdobbs.com/architecture-and-design/231903053

科普性文章。x86是CISC指令集的CPU(AMD也是)。在很早之前RISC和CISC是共存的,RISC性能并行性都比较好,主要用于大型机以及高性能计算方面,而CISC通常只用于桌面和终端系统上。但是随着x86和AMD在CPU性能方面不断地改进以及市场推广,加上GPU对于图形显示方面的加强,RISC似乎失去了永无之地。但是随着移动设备的崛起,突然有一种RISC指令集的CPU异常地适用,就是ARM,优势主要体现在低功耗以及功耗比方面。然后x86也开始关注到了这块市场,推出了Atom处理器,但是在功耗和功耗比方面和ARM依然相差很远。

3 linux syslog on cpu

3.1 Core power limit notifaction

May 12 12:29:12 dp57 kernel: CPU1: Core power limit notification (total events = 42322)
May 12 12:29:12 dp57 kernel: CPU17: Core power limit notification (total events = 42321)
May 12 12:29:12 dp57 kernel: CPU5: Core power limit notification (total events = 42328)
May 12 12:29:12 dp57 kernel: CPU21: Core power limit notification (total events = 42327)
May 12 12:29:12 dp57 kernel: CPU19: Core power limit notification (total events = 42327)
May 12 12:29:12 dp57 kernel: CPU3: Core power limit notification (total events = 42327)
May 12 12:29:12 dp57 kernel: CPU7: Core power limit notification (total events = 42323)
May 12 12:29:12 dp57 kernel: CPU23: Core power limit notification (total events = 42322)
May 12 12:29:12 dp57 kernel: CPU25: Core power limit notification (total events = 42226)
May 12 12:29:12 dp57 kernel: CPU9: Core power limit notification (total events = 42222)
May 12 12:29:12 dp57 kernel: CPU11: Core power limit notification (total events = 42222)
May 12 12:29:12 dp57 kernel: CPU27: Core power limit notification (total events = 42219)
May 12 12:29:12 dp57 kernel: CPU13: Core power limit notification (total events = 42321)
May 12 12:29:12 dp57 kernel: CPU29: Core power limit notification (total events = 42307)
May 12 12:29:12 dp57 kernel: CPU15: Core power limit notification (total events = 42556)
May 12 12:29:12 dp57 kernel: CPU31: Core power limit notification (total events = 42550)

3.2 Package power limit notification

May 12 12:29:12 dp57 kernel: CPU17: Package power limit notification (total events = 42377)
May 12 12:29:12 dp57 kernel: CPU5: Package power limit notification (total events = 42612)
May 12 12:29:12 dp57 kernel: CPU21: Package power limit notification (total events = 42615)
May 12 12:29:12 dp57 kernel: CPU19: Package power limit notification (total events = 42553)
May 12 12:29:12 dp57 kernel: CPU3: Package power limit notification (total events = 42543)
May 12 12:29:12 dp57 kernel: CPU7: Package power limit notification (total events = 42661)
May 12 12:29:12 dp57 kernel: CPU23: Package power limit notification (total events = 42667)
May 12 12:29:12 dp57 kernel: CPU25: Package power limit notification (total events = 42707)
May 12 12:29:12 dp57 kernel: CPU9: Package power limit notification (total events = 42706)
May 12 12:29:12 dp57 kernel: CPU11: Package power limit notification (total events = 42705)
May 12 12:29:12 dp57 kernel: CPU27: Package power limit notification (total events = 42731)
May 12 12:29:12 dp57 kernel: CPU13: Package power limit notification (total events = 42619)
May 12 12:29:12 dp57 kernel: CPU29: Package power limit notification (total events = 42627)
May 12 12:29:12 dp57 kernel: CPU15: Package power limit notification (total events = 42623)
May 12 12:29:12 dp57 kernel: CPU31: Package power limit notification (total events = 42644)
May 12 12:29:12 dp57 kernel: CPU1: Package power limit notification (total events = 42360

3.3 below trip temperature. Throttling disabled

May 12 12:29:40 dp57 mcelog: Processor 17 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 5 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 21 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 19 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 3 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 7 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 23 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 25 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 9 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 11 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 27 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 13 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 29 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 15 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 17 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 31 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 5 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 21 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 19 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 3 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 7 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 23 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 25 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 9 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 11 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 27 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 13 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 29 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 15 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 31 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 1 below trip temperature. Throttling disabled
May 12 12:29:40 dp57 mcelog: Processor 1 below trip temperature. Throttling disabled

4 对称多处理器架构

对称多处理器(SMP); 主板架构

smp-arch.jpg motherboard-arch.jpg

cpu总线式结构对高速缓存进行监听(snooping); 在smp环境下总过锁住总线允许单个cpu对存储器读写操作满足原子性

cpu-bus-snooping.png smp-bus-race.png

comments powered by Disqus