วิธีการตรวจสอบว่า CPU ของเราเป็นแบบไหน


#cat /proc/cpuinfo

ดูบรรทัด

“physical id” คือค่าของ processor socket เอาไว้ใช้ดูว่ามีกี่ processor

“siblings” คือค่า logical processors (ค่าจะเท่ากัน)

“cpu cores” คือค่า physical cores ของแต่ละ physical processor

Single-processor, Single-core, HT

processor        0 1
physical id    0 0
siblings        2 2
core id         0 0
cpu cores        1 1 

จากตัวอย่างนี้จะเห็นว่า physical id มีเลข 0 อย่างเดียวแสดงว่าเป็น Single-processor , siblings มีค่า 2 แสดงว่ามี 2 logical processors และสุดท้าย cpu core มีเลข 1 อย่างเดียวแสดงว่ามี 1 core เป็น HT เพราะว่า siblings หาร cpu cores แล้วผลลัพธ์ได้ค่าเท่ากับ 2 (2 เท่าของ processor จริง)
Single-processor, Dual-core, non-HT

processor        0 1
physical id    0 0
siblings        2 2
core id         0 1
cpu cores        2 2  

จากตัวอย่างนี้จะเห็นว่า physical id มีเลข 0 อย่างเดียวแสดงว่าเป็น Single-processor , siblings มีค่า 2 แสดงว่ามี 2 logical processors และสุดท้าย cpu core มีเลข 2 อย่างเดียวแสดงว่ามี 2 core เป็น non-HT เพราะว่า siblings หาร cpu cores แล้วผลลัพธ์ได้ค่าเท่ากับ 1
Dual-processor, Single-core, HT

processor    0 1 2 3
physical id    0 3 0 3
siblings    2 2 2 2
core id     0 3 0 3
cpu cores    1 1 1 1 

จากตัวอย่างนี้จะเห็นว่า physical id มีเลข 0,3 อย่างเดียวแสดงว่าเป็น Dual-processor , siblings มีค่า 2 แสดงว่ามี 2 logical processors และสุดท้าย cpu core มีเลข 1 อย่างเดียวแสดงว่ามี 1 core เป็น HT เพราะว่า siblings หาร cpu cores แล้วผลลัพธ์ได้ค่าเท่ากับ 2

จากตัวอย่างอื่นๆด้านล่างให้ลองฝึกดูนะครับ จะได้ชำนาญในการดูว่า CPU ที่ใช้อยู่เป็นแบบไหน
Dual-processor, Dual-core, HT

processor    0 1 2 3 4 5 6 7
physical id    0 0 0 0 1 1 1 1
siblings    4 4 4 4 4 4 4 4
core id     0 0 1 1 0 0 1 1
cpu cores    2 2 2 2 2 2 2 2   

Single-processor, Quad-core, non-HT

processor    0 1 2 3
physical id    0 0 0 0
siblings    4 4 4 4
core id     0 2 1 3
cpu cores    4 4 4 4 

Dual-processor, Quad-core, non-HT

processor    0 1 2 3 4 5 6 7
physical id    0 1 0 1 0 1 0 1
siblings    4 4 4 4 4 4 4 4
core id     0 0 1 1 2 2 3 3
cpu cores    4 4 4 4 4 4 4 4 

Dual-processor, Quad-core, HT

processor    0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
physical id    0  0  0  0  0  0  0  0  1  1  1  1  1  1  1  1
siblings    8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8
core id        0  0  1  1  2  2  3  3  0  0  1  1  2  2  3  3
cpu cores    4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4 

 

*** ข้อมูลจาก blog ezlinux.com

 

 

คำสำคัญ (Tags): #cpuinfo#linux
หมายเลขบันทึก: 229666เขียนเมื่อ 15 ธันวาคม 2008 11:05 น. ()แก้ไขเมื่อ 22 มิถุนายน 2012 11:38 น. ()สัญญาอนุญาต: จำนวนที่อ่านจำนวนที่อ่าน:


ความเห็น (2)

อืมม น่าสนใจดีครับ ไม่เคยรู้มาก่อนเลย ขอบคุณครับ

พบปัญหาการใช้งานกรุณาแจ้ง LINE ID @gotoknow
ClassStart
ระบบจัดการการเรียนการสอนผ่านอินเทอร์เน็ต
ทั้งเว็บทั้งแอปใช้งานฟรี
ClassStart Books
โครงการหนังสือจากคลาสสตาร์ท