How To Tell if Your Machine is SMP or Hyperthreaded

Here’s a quick tip from what I learned this morning. If you have a machine running linux and you can’t tell if you have two physical CPUs (SMP) or one physical CPU with Hyperthreading it’s a pain. As far as linux is concerned both show the same number of CPUs in top, /proc/cpuinfo, etc. However, if you run:

server:/# dmesg | grep -i physical
CPU: Physical Processor ID: 0
CPU: Physical Processor ID: 0
server:/#

You’ll see the physical processor ID. In the above example, this is a single physical processor with hyperthreading. If there were two you’d see something like:

CPU: Physical Processor ID: 0
CPU: Physical Processor ID: 3
CPU: Physical Processor ID: 0
CPU: Physical Processor ID: 3

Four separate CPUs, but only two separate CPU IDs (0 and 3) indicating this has two physical processors both with hyperthreading.

2 Comments on “How To Tell if Your Machine is SMP or Hyperthreaded”

  1. This doesn’t seem to differentiate between HyperThreading and multiple cores though, my dual core cpu gives the same physical id for both cores.