Find CPU Information in Linux from /proc/cpuinfo

Another great proc variable for CPU information is the /proc/cpuinfo which provides the current system’s cpu information.  If you execute a:

erik@debian:~$ cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 75
model name      : AMD Athlon(tm) 64 X2 Dual Core Processor 4600+
stepping        : 2
cpu MHz         : 2400.000
cache size      : 512 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy
bogomips        : 4809.40
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 75
model name      : AMD Athlon(tm) 64 X2 Dual Core Processor 4600+
stepping        : 2
cpu MHz         : 2400.000
cache size      : 512 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy
bogomips        : 4809.40
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc

In this case I have a dual core system, hence the processor 0 and processor 1.

In this list there is some great information.

  • model name, obviously who makes the CPU
  • stepping, in this case 2.  This means this is essentially rev 2 of this CPU.  Some steps or version may be more over-clockable than others.
  • cpu MHZ.  This is the actual speed of the processor.  In this case 2400 MHz, or 2400 (Hundred) Million operations per second.
  • cache size.  This is the amount of layer 2 cache for this core.
  • bogomips.  Essentially the number of million times per second a processor can do absolutely nothing.  An unscientific measurement of CPU speed.
  • cache alignment.  In this case I have a 64bit CPU, and thus any data structures in C should be 64bit aligned.  This is especially important when using pointers in C, as you might get odd behaviour if your data structures are not padded to 64bits.

Those are the main pieces to look at.  If you are curious about the other fields, google google google!

Comments are closed.