Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1934615
  • 博文数量: 389
  • 博客积分: 7877
  • 博客等级: 少将
  • 技术积分: 4531
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-10 14:02
文章分类

全部博文(389)

文章存档

2024年(1)

2022年(1)

2021年(1)

2020年(1)

2019年(1)

2018年(3)

2017年(6)

2016年(4)

2015年(8)

2014年(15)

2013年(31)

2012年(19)

2011年(47)

2010年(33)

2009年(105)

2008年(109)

2007年(4)

分类:

2008-02-11 08:59:46

先看下面这个输出:
[root@KABTST01 /]# vmstat 1 10

System configuration: lcpu=4 mem=3744MB

kthr    memory              page              faults        cpu   
----- ----------- ------------------------ ------------ -----------
 r  b   avm   fre  re  pi  po  fr   sr  cy  in   sy  cs us sy id wa
 0  0 1767377 15508   0   0   0   0    0   0  12 2404 1291  0  1 98  1
 0  0 1767377 15508   0   0   0   0    0   0  14 3156 1302  0  1 98  0
 0  0 1767377 15508   0   0   0   0    0   0   7 2662 1361  0  1 99  0
 0  0 1767377 15508   0   0   0   0    0   0  15 2034 1381  0  1 98  1
 0  0 1767377 15508   0   0   0   0    0   0   5 2170 1375  0  1 99  0
 0  0 1767377 15508   0   0   0   0    0   0  14 2364 1334  0  1 98  1
 0  0 1767377 15508   0   0   0   0    0   0   8 2078 1342  0  1 99  0
 0  0 1767377 15508   0   0   0   0    0   0   9 3431 2560  5  2 93  0
 0  0 1767377 15507   0   0   0   0    0   0  13 10119 1312  2  2 96  1
 0  0 1767377 15507   0   0   0   0    0   0   5 2205 1284  0  1 99  0


再看它实际的CPU数:
[root@KABTST01 /]# lsdev -Cc processor
proc0 Available 00-00 Processor
proc2 Available 00-02 Processor

即该p5 server有两颗CPU, 但是我们看到的lcpu数为什么是4呢,继续往下看:
[root@KABTST01 /]# lsattr -El proc0
frequency   1498500000     Processor Speed       False
smt_enabled true           Processor SMT enabled False
smt_threads 2              Processor SMT threads False
state       enable         Processor state       False
type        PowerPC_POWER5 Processor type        False
[root@KABTST01 /]# lsattr -El proc2
frequency   1498500000     Processor Speed       False
smt_enabled true           Processor SMT enabled False
smt_threads 2              Processor SMT threads False
state       enable         Processor state       False
type        PowerPC_POWER5 Processor type        False

SMT是什么,看下面这个:
[root@KABTST01 /]# smtctl

This system is SMT capable.

SMT is currently enabled.

SMT boot mode is not set.
SMT threads are bound to the same physical processor.

proc0 has 2 SMT threads.
Bind processor 0 is bound with proc0
Bind processor 1 is bound with proc0


proc2 has 2 SMT threads.
Bind processor 2 is bound with proc2
Bind processor 3 is bound with proc2

还可以通过下面这个命令看到:
[root@KABTST01 /]# bindprocessor -q
The available processors are:  0 1 2 3

最后再看看IBM给出的SMT的解释:

SMT is the ability of a single physical processor to concurrently dispatch instructions from more than one hardware thread. In AIX 5L Version 5.3, a dedicated partition created with one physical processor is configured as a logical two-way by default. Two hardware threads can run on one physical processor at the same time. SMT is a good choice when overall throughput is more important than the throughput of an individual thread. For example, Web servers and database servers are good candidates for SMT.


By default, the SMT is enabled


再看网上同样关于这个问题的回答:

jhidalgo wrote:
> Hi all,
>
> someone knows why i get 16 LCPUs in many performance tools when i only
> have 8 physical CPUs in my box ?


You have a p5 machine running AIX 5.3 which therefore supports
Simultaneous Multithreading (SMT), which uses additional registers on
the chip to make a single CPU look like two to the OS. Understanding the
performance you're getting needs a little more understanding than in a
non-SMT environment but it's worth it - for about 10% more transistors
you can get up to 30% better performance.


“最早推出双核处理器的IBM也是这一趋势的推动者”,所以实际上看到的两颗CPU的lcpu数是4的原因是每个CPU都是双核处理器,这个在IBM服务器上是default的

阅读(1469) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2008-10-25 17:31:24

并发多线程,指单一物理处理器能够同时分发来自多于一个硬件线程上下文的指令,可以虚化成2个逻辑的CPU