[Gllug] Dual core

Yashpal Nagar yash at linux-delhi.org
Tue May 15 14:10:17 UTC 2007


Daniel P. Berrange wrote:
> On Tue, May 15, 2007 at 02:17:30PM +0100, Yashpal Nagar wrote:
>   
>> Hi!
>>
>> How do we figure out if the CPU is dual core? i am running RHEL 3/4 and 
>> SUSE 10.
>> I have used lshw, /proc/cpuinfo but none of them tell this arch of CPU.
>>     
>
> The cpuinfo file has a 'physical id' field which refers to the physical
> socket the logical CPU is in. So if two CPUs have same physical ID, then 
> are a pair of cores in the same socket.
>
> eg
>
> $ grep -E '(processor|physical)' /proc/cpuinfo 
> processor       : 0
> physical id     : 0
> processor       : 1
> physical id     : 0
>
> ...Shows a single physical CPU, with two cores
>
>
> # grep -E '^(processor|physical)' /proc/cpuinfo
> processor       : 0
> physical id     : 0
> processor       : 1
> physical id     : 3
> processor       : 2
> physical id     : 0
> processor       : 3
> physical id     : 3
>
> ...shows a pair of physical CPUs, each with two cores.
>
> NB, I'm ignoring hyperthreading here which would also show us as two
> cpus with same physical id - you'd need other heuristics to distinguish
> a pair of cores, from a pair of hyperthreads.
>
> Dan.
>   
Thanks Dan,

I got the point, in nutshell the count of as many processors sharing the 
same physical id tells how many core it is.

[root at loghost root]# grep -E '(processor|physical)' /proc/cpuinfo
processor       : 0
physical id     : 0
processor       : 1
physical id     : 3
[root at loghost root]#

like in my case it is two processor with single core each.

Regards
Yashpal





-- 
ASCII ribbon campaign ( )
 - against HTML email  X
             & vCards / \

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list