Re: How to detect multi-core and/or HT-enabled CPUs in 2.4.x and2.6.x kernels

From: Jan Engelhardt
Date: Wed Dec 27 2006 - 09:37:37 EST

On Dec 27 2006 06:16, Martin Knoblauch wrote:
> So far it seems that looking at the "physical id", "core id" and "cpu
>cores" of /proc/cpuinfo is the way to go.

Possibly, but it does not catch all cases.

$grep '"physical id' /erk/kernel/linux-2.6.20-rc2/ -r

returns exactly three lines, for

So what'cha doing about, say, sparc64? Here is its procinfo of a
standard SMP one:

15:31 ares:~ # cat /proc/cpuinfo
cpu : TI UltraSparc II (BlackBird)
fpu : UltraSparc II integrated FPU
prom : OBP 3.30.0 2003/11/11 10:37
type : sun4u
ncpus probed : 2
ncpus active : 2
D$ parity tl1 : 0
I$ parity tl1 : 0
Cpu0Bogo : 800.49
Cpu0ClkTck : 0000000017d78400
Cpu1Bogo : 800.05
Cpu1ClkTck : 0000000017d78400
MMU Type : Spitfire
CPU0: online
CPU1: online

> In 2.6 I would try to find the distinct "physical id"s and and sum
>up the corresponding "cpu cores". The question is whether this would
>work for 2.4 based systems.
> Does anybody recall when the "physical id", "core id" and "cpu cores"
>were added to /proc/cpuinfo ?

Why don't you check it out? 2.4.34 only has the "physical id" string for
x86_64. It does not seem to have CONFIG_SCHED_SMT at all. (Time to leave
the dead horse alone.)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at