理解 /proc/cpuinfo

理解 /proc/cpuinfo

processor       : 0

vendor_id       : GenuineIntel

cpu family      : 15

model          : 6

model name     : Intel(R) Pentium(R) 4 CPU 3.00GHz

stepping        : 5

cpu MHz          : 3143.295

cache size        : 0 KB

physical id         0

siblings          : 1

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug       : no

fpu             : yes

fpu_exception     : yes

cpuid level       : 6

wp              : yes

flags           : fpu vme pse tsc msr pae cx8 sep pge cmov acpi mmx fxsr sse sse2

bogomips       : 1674.44

rpm i386 i586 i686 之間的區別

有的rpm 有分i386 i586 i686 等不同版本,如:
  abc-1.2.3-4.i386.rpm
  abc-1.2.3-4.i586.rpm
  abc-1.2.3-4.i686.rpm
  它們有什麼不同呢?


  這裏的i386 i586 i686 指的是適用於intel i386 i586i686 兼容指令集的微處理器。一般來說,等級愈高的機器可接受較低等級的rpm 文件。
i386
—幾乎所有的X86 平臺,不論是舊的pentum 或者是新的pentum-IVK7 系統CPU ,都可以正常工作,i 指得是Intel 兼容的CPU ,至於386 就是CPU 的等級。

i586 —就是586 等級的計算機,包括pentum 第一代MMX CPUAMDK5K6 系統CPUsocket7 插腳)等CPU 都是這個等級。

i686pentum 2 以後的Intel 系統CPUK7 以後等級的CPU 都屬於這個686 等級。
你可以透過/proc/cpuinfo 這個檔案查詢你的CPU 等級。

/proc/cpuinfo

This virtual file identifies the type of processor used by your system. The following is an example of the output typical of /proc/cpuinfo:

        
 
processor : 0 vendor_id : GenuineIntel cpu family : 15 model : 2 model name : Intel(R) Xeon(TM) CPU 2.40GHz stepping : 7 cpu MHz : 2392.371 cache size : 512 KB physical id : 0 siblings : 2 runqueue : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm bogomips : 4771.02 

      

<!--[if !supportLists]-->·         <!--[endif]-->processor Provides each processor with an identifying number. On systems that have one processor, only a 0 is present.

<!--[if !supportLists]-->·         <!--[endif]-->cpu family Austhoritatively identifies the type of processor in the system. For an Intel-based system, place the number in front of "86" to determine the value. This is particularly helpful for those attempting to identify the architecture of an older system such as a 586 , 486, or 386. Because some RPM packages are compiled for each of these particular architectures, this value also helps users determine which packages to install.

<!--[if !supportLists]-->·         <!--[endif]-->model name Displays the common name of the processor, including its project name.

<!--[if !supportLists]-->·         <!--[endif]-->cpu MHz Shows the precise speed in megahertz for the processor to the thousandths decimal place.

<!--[if !supportLists]-->·         <!--[endif]-->cache size Displays the amount of level 2 memory cache available to the processor.

<!--[if !supportLists]-->·         <!--[endif]-->siblings Displays the number of sibling CPUs on the same physical CPU for architectures which use hyper-threading.

<!--[if !supportLists]-->·         <!--[endif]-->flags Defines a number of different qualities about the processor, such as the presence of a floating point unit (FPU) and the ability to process MMX instructions.

Understanding /proc/cpuinfo

Example:

$ uname -r
2.6.18-8.el5

How many physical processors are there?

grep 'physical id' /proc/cpuinfo | sort | uniq | wc -l
2

How many virtual processors are there?

$ grep ^processor /proc/cpuinfo | wc -l
4

Are the processors dual-core (or multi-core)?

$ grep 'cpu cores' /proc/cpuinfo
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2
cpu cores       : 2


"2" indicates the two physical processors are dual-core, resulting in 4 virtual processors.

If "1" was returned, the two physical processors are single-core. If the processors are single-core, and the number of virtual processors is greater than the number of physical processors, the CPUs are using hyper-threading. Hyper-threading is supported if
ht is present in the CPU flags and you are using an SMP kernel.

Are the processors 64-bit?

A 64-bit processor will have lm ("long mode") in the  flags section of cpuinfo . A 32-bit processor will not.

e.g.,

flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8legacy ts fid vid ttp tm stc

What do the CPU flags mean?

The CPU flags are briefly described in the kernel header file cpufeature.h .

 

proc/cpuinfo  確定系統的 CPU 情況

 

  一些操作系統的最新版本已經更新了 /proc/cpuinfo 文件,以支持多路平臺。如果您的系統中的 /proc/cpuinfo 文件能夠正確地反映出處理器信息,那麼就不需要執行上述步驟。反之,可採用本文中的信息進行解釋。

/proc/cpuinfo
文件包含系統上每個處理器的數據段落。 /proc/cpuinfo 描述中有 6 個條目適用於多內核和超線程( HT )技術檢查: processor , vendor id , physical id , siblings , core id cpu cores

  • processor 條目包括這一邏輯處理器的唯一標識符。
  • physical id 條目包括每個物理封裝的唯一標識符。
  • core id 條目保存每個內核的唯一標識符。
  • siblings 條目列出了位於相同物理封裝中的邏輯處理器的數量。
  • cpu cores 條目包含位於相同物理封裝中的內核數量。
  • 如果處理器爲英特爾處理器,則 vendor id 條目中的字符串是 GenuineIntel


擁有相同 physical id 的所有邏輯處理器共享同一個物理插座。每個 physical id 代表一個唯一的物理封裝。 Siblings 表示位於這一物理封裝上的邏輯處理器的數量。它們可能支持也可能不支持超線程( HT )技術。每個 core id 均代表一個唯一的處理器內核。所有帶有相同 core id 的邏輯處理器均位於同一個處理器內核上。如果有一個以上邏輯處理器擁有相同的 core id physical id ,則說明系統支持超線程( HT )技術。如果有兩個或兩個以上的邏輯處理器擁有相同的 physical id ,但是 core id 不同,則說明這是一個多內核處理器。 cpu cores 條目也可以表示是否支持多內核。

例如,如果系統包含兩個物理封裝,每個封裝中又包含兩個支持超線程( HT )技術的處理器內核,則 /proc/cpuinfo 文件將包含此數據。(注:數據並不在表格中。)
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->

 processor

 0

 1

 2

 3

 4

 5

 6

 7

 physical id

 0

 1

 0

 1

 0

 1

 0

 1

 core id

 0

2

1

 3

 0

 2

 1

 3

 siblings

 4

 4

 4

 4

 4

 4

 4

 4

 cpu cores

 2

 2

 2

 2

 2

 2

 2

 2


此例說明邏輯處理器 0 4 駐留在物理封裝 0 的內核 0 上。這就表示邏輯處理器 0 4 支持超線程( HT )技術。相同的工作可用於封裝 0 內核 1 上的邏輯處理器 2 6 ,封裝 1 內核 2 上的邏輯處理器 1 5 ,以及封裝 1 內核 3 上的邏輯處理器 3 7 。此係統支持超線程( HT )技術,因爲兩個邏輯處理器共享同一個內核。有兩種方式可以確定是否支持多內核。由於內核 0 1 存在於封裝 0 上,而內核 2 3 存在於封裝 1 上,所以這是一個多內核系統。此外, cpu cores 條目爲 2 ,也說明有兩個內核駐留在物理封裝中。這是一個多路系統,因爲有兩個封裝。

值得注意的是 physical id core id 的編號可能是也可能不是連續的。系統上有兩個物理封裝並不罕見,而且 physical id 等於 0 3

CPU ID

CPU ID CPU 生產廠家爲識別不同類型的 CPU ,而爲 CPU 制訂的不同的單一的代碼;不同廠家的 CPU ,其 CPU ID 定義也是不同的;如 “0F24” Inter 處理器)、 “681H” AMD 處理器),根據這些數字代碼即可判斷 CPU 屬於哪種類型,這就是一般意義上的 CPU ID  
於計算機使用的是十六進制,因此 CPU ID 也是以十六進制表示的。 Inter 處理器的 CPU ID 一共包含四個數字,如 “0F24” ,從左至右分別表示 Type (類型)、 Family (系列)、 Mode (型號)和 Stepping (步進編號)。從 CPUID “068X” 的處理器開始, Inter 另外增 加了 Brand ID (品種標識)用來輔助應用程序識別 CPU 的類型,因此根據 “068X”CPUID 還不能正確判別 Pentium Celerom 處理 器。必須配合 Brand ID 來進行細分。 AMD 處理器一般分爲三位,如 “681” ,從左至右分別表示爲 Family (系列)、 Mode (型號)和 Stepping (步進編號)。  
Type
(類型)  
類型標識用來區別 INTEL 微處理器是用於由最終用戶安裝,還是由專業個人計算機系 統集成商、服務公司或製作商安裝;數字 “1” 標識所測試的微處理器是用於由用戶安裝的;數字 “0” 標識所測試的微處理器是用於由專業個人計算機系統集成 商、服務公司或製作商安裝的。我們通常使用的 INTEL 處理器類型標識都是 “0” “0F24”CPUID 就屬於這種類型。  
Family
(系列)  
列標識可用來確定處理器屬於那一代產品。如 6 系列的 INTEL 處理器包括 Pentium Pro Pentium II Pentium II Xeon Pentium III Pentium III Xeon 處理器。 5 系列(第五代)包括 Pentium 處理器和採用 MMX 技術的 Pentium 處理器。 AMD 6 系列實際指有 K7 系列 CPU ,有 DURON ATHION 兩大類。最新一代的 INTEL Pentium 4 系列處理器(包括相同核心的 Celerom 處理器)的系列值爲 “F” 
Mode
(型號)  
型號標識可用來 確定處理器的製作技術以及屬於該系列的第幾代設計(或核心),型號與系列通常是相互配合使用的,用於確定計算機所安裝的處理器是屬於某系列處理器的哪種特 定類型。如可確定 Celerom 處理器是 Coppermine 還是 Tualutin 核心; Athlon XP 處理器是 Paiomino 還是 Thorouhgbred 核心。  
Stepping
(步進編號)  
步進編號用來標識處理器的設計或製作版本,有助於控制和跟蹤處理器的更 改,步進還可以讓最終用戶更具體地識別其系統安裝的處理器版本,確定微處理器的內部設計或製作特性。步進編號就好比處理器的小版本號,如 CPUID “686” “686A” 就好比 WINZIP8.0 8.1 的關係。步進編號和核心步進是密切聯繫的。如 CPUID “686” Pentium III 處理器是 cCO 核心,而 “686A” 表示的是更新版本 cD0 核心。  
Brand ID
(品種標識)  
INTEL
Coppermine 核心的處理器開始引入 Brand ID 作爲 CPU 的輔助識別手段。如我們通過 Brand ID 可以識別出處理器究竟是 Celerom 還是 Pentium 4

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章