2011-06-20 32 views
0

我正在使用Intel Westmere處理器。 westmere的體系結構由12個CPU芯片排列成2個芯片組成。所以這意味着每個芯片都包含6個內核。2芯片組中的CPU內核訂購號/編號Intel Westmere

我不知道如何訂購或編號的CPU核心。我的猜測是,它可以如下:

  1. 核心0,1,2,3,4和5是在一個芯片和核心6,7,8,9,10和11是 第二芯片
  2. 芯0,2,4,6,8,和10是在一個芯片上和核心上1,3,5,7,9和11 是第二芯片上

有誰知道CPU核心的排序/編號

+0

對不起,我不知道答案。但你激起了我的好奇心:現在我很想知道你需要這些信息。 – nfechner

+0

@nfechner:如果我知道如何訂購核心,我可以相應地重新安排我的線程。目前,我無法利用所有12個內核。 8個線程的性能要比12個線程的性能好得多。 – veda

+0

感謝您的信息。 – nfechner

回答

0

它們是假設要交錯,以便採取連續的核心儘可能擴展負載。如果0和1在同一個芯片上,那麼只使用兩個內核的樸素代碼會浪費一半的緩存。

如此編號的核心應先交替物理CPU。如果可能的話,他們應該下次交替死亡。然後他們應該通過一個芯片通過核心。如果可能的話,他們應該包含虛擬內核。因此,如果您有兩個物理CPU(P1,P2),每個雙核(C1,C2)和每個超線程(V1,V2),內核應執行以下操作: P1C1V1,P2C1V1,P1C2V1,P2C2V1,P2C1V1,P1C2V1,P2C2V1, P1C1V2,P2C1V2,P1C2V2,P2C2V2

其理由是允許不理解CPU拓撲的代碼只抓取儘可能多的內核,因爲它知道如何使用並獲得最佳性能。如果你只能支持兩個內核,你需要P1C1V1和P2C1V1,而不是P1C1V1和P1C1V2,否則你會大量浪費緩存和執行單元。

1

欲瞭解更多信息,你可以嘗試使用這個工具: http://software.intel.com/en-us/articles/intel-64-architecture-processor-topology-enumeration

這是確定的官方工具。

下面是運行CentOS 5.3的兩臺物理Intel X5560(6core + 6HT)(可能有點老)的機器運行示例。

Package 0 Cache and Thread details 

Box Description: 
Cache is cache level designator 
Size is cache size 
OScpu# is cpu # as seen by OS 
Core is core#[_thread# if > 1 thread/core] inside socket 
AffMsk is AffinityMask(extended hex) for core and thread 
CmbMsk is Combined AffinityMask(extended hex) for hw threads sharing cache 
     CmbMsk will differ from AffMsk if > 1 hw_thread/cache 
Extended Hex replaces trailing zeroes with 'z#' 
     where # is number of zeroes (so '8z5' is '0x800000') 
L1D is Level 1 Data cache, size(KBytes)= 32, Cores/cache= 2, Caches/package= 4 
L1I is Level 1 Instruction cache, size(KBytes)= 32, Cores/cache= 2, Caches/package= 4 
L2 is Level 2 Unified cache, size(KBytes)= 256, Cores/cache= 2, Caches/package= 4 
L3 is Level 3 Unified cache, size(KBytes)= 8192, Cores/cache= 8, Caches/package= 1 
     +-----------+-----------+-----------+-----------+ 
Cache | L1D  | L1D  | L1D  | L1D  | 
Size | 32K  | 32K  | 32K  | 32K  | 
OScpu#| 0  8| 1  9| 2 10| 3 11| 
Core |c0_t0 c0_t1|c1_t0 c1_t1|c2_t0 c2_t1|c3_t0 c3_t1| 
AffMsk| 1 100| 2 200| 4 400| 8 800| 
CmbMsk| 101  | 202  | 404  | 808  | 
     +-----------+-----------+-----------+-----------+ 

Cache | L1I  | L1I  | L1I  | L1I  | 
Size | 32K  | 32K  | 32K  | 32K  | 
     +-----------+-----------+-----------+-----------+ 

Cache | L2  | L2  | L2  | L2  | 
Size | 256K  | 256K  | 256K  | 256K  | 
     +-----------+-----------+-----------+-----------+ 

Cache | L3           | 
Size | 8M           | 
CmbMsk| f0f           | 
     +-----------------------------------------------+ 

Combined socket AffinityMask= 0xf0f 

Package 1 Cache and Thread details 

Box Description: 
Cache is cache level designator 
Size is cache size 
OScpu# is cpu # as seen by OS 
Core is core#[_thread# if > 1 thread/core] inside socket 
AffMsk is AffinityMask(extended hex) for core and thread 
CmbMsk is Combined AffinityMask(extended hex) for hw threads sharing cache 
     CmbMsk will differ from AffMsk if > 1 hw_thread/cache 
Extended Hex replaces trailing zeroes with 'z#' 
     where # is number of zeroes (so '8z5' is '0x800000') 
     +-----------+-----------+-----------+-----------+ 
Cache | L1D  | L1D  | L1D  | L1D  | 
Size | 32K  | 32K  | 32K  | 32K  | 
OScpu#| 4 12| 5 13| 6 14| 7 15| 
Core |c0_t0 c0_t1|c1_t0 c1_t1|c2_t0 c2_t1|c3_t0 c3_t1| 
AffMsk| 10 1z3| 20 2z3| 40 4z3| 80 8z3| 
CmbMsk| 1010  | 2020  | 4040  | 8080  | 
     +-----------+-----------+-----------+-----------+ 

Cache | L1I  | L1I  | L1I  | L1I  | 
Size | 32K  | 32K  | 32K  | 32K  | 
     +-----------+-----------+-----------+-----------+ 

Cache | L2  | L2  | L2  | L2  | 
Size | 256K  | 256K  | 256K  | 256K  | 
     +-----------+-----------+-----------+-----------+ 

Cache | L3           | 
Size | 8M           | 
CmbMsk| f0f0           | 
     +-----------------------------------------------+