Messages in this thread | | | Date | Wed, 27 Dec 2006 15:37:01 +0100 (MET) | From | Jan Engelhardt <> | Subject | Re: How to detect multi-core and/or HT-enabled CPUs in 2.4.x and 2.6.x kernels |
| |
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 /erk/kernel/linux-2.6.20-rc2/arch/i386/kernel/cpu/proc.c /erk/kernel/linux-2.6.20-rc2/arch/ia64/kernel/setup.c /erk/kernel/linux-2.6.20-rc2/arch/x86_64/kernel/setup.c
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 State: 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.)
-`J' -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |