LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-29-2009, 09:07 AM   #1
manojg
Member
 
Registered: May 2004
Posts: 78

Rep: Reputation: 15
number of cpu core


Hi,

I am trying to find the whether it dual core, or two physical cpu or simply HT case in my cpu. Here is the output from /proc/cpuinfo:

---------------------------
processor : 0
vendor_id : GenuineIntel
model name : Intel(R) Xeon(TM) CPU 2.40GHz
stepping : 7
cpu MHz : 2399.778
cache size : 512 KB
physical id : 0
siblings : 1
fdiv_bug : no

................

processor : 1
vendor_id : GenuineIntel
model name : Intel(R) Xeon(TM) CPU 2.40GHz
stepping : 7
cpu MHz : 2399.778
cache size : 512 KB
physical id : 0
siblings : 1
fdiv_bug : no
---------------------------
There is no number of core mentioned.
Which case is this dual core, or two physical cpu, or HT? How do I know that (let us say the /proc/cpuinfo output is different)?

Thanks.

Last edited by manojg; 06-29-2009 at 09:10 AM.
 
Old 06-29-2009, 09:36 AM   #2
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
"lshw -class processor" seems to do it
 
Old 06-29-2009, 09:38 AM   #3
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
siblings and cores

example:
Code:
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      :               Intel(R) Pentium(R) D CPU 2.80GHz
stepping        : 7
cpu MHz         : 2793.000
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2

   ...

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      :               Intel(R) Pentium(R) D CPU 2.80GHz
stepping        : 7
cpu MHz         : 2793.000
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
   ...
i'd guess your looking at either dual-socket or single-socket w/HT.
without more info, you could try looking at 'dmidecode' output to see.
look for the number of sockets available/populated
Code:
dmidecode -t processor

 
Old 06-29-2009, 09:39 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
/proc/cpuinfo shows you a CPU for each core (starting at 0)

dmidecode will show you tons of information and will show you each CPU as CPU1, CPU2 etc...

So on my dual quad-core system /proc/cpuinfo shows 8 cores (CPUs 0 through 7) and dmidecode shows only 2 CPUs (CPU1 and CPU2). That lets me know I have two cpus with four cores each.
 
Old 06-29-2009, 09:44 AM   #5
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
Generally, with a dual-core processor you see "core-id" and "cpu cores" fields in /proc/cpuinfo. With a hyperthreaded CPU, you'll see the "ht" flag. If you don't have either, I'd say you have two CPUs.
 
Old 06-29-2009, 10:27 AM   #6
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by Uncle_Theodore View Post
Generally, with a dual-core processor you see "core-id" and "cpu cores" fields in /proc/cpuinfo.
Even without dual-core, I usually see "core-id", it's just the same value for logical processors split by hyperthreading.

Since I don't know why the OP doesn't have core-id listed, I can't conclude that means single core. Maybe the kernel is older and puts less info in /proc/cpuinfo

Quote:
With a hyperthreaded CPU, you'll see the "ht" flag.
True and we don't know whether the OP has "ht" in his flags list. But probably "ht" is there and that wouldn't tell us much. I think ht can be there when the CPU doesn't actually support hyperthreading (I don't know why that happens, but I've seen it). I know ht can be there when the CPU supports hyperthreading but the BIOS has disabled it.

So if ht is not there, this must be dual-core, but if ht is there, this might be hyperthreading, but still might be dual core.

Quote:
If you don't have either, I'd say you have two CPUs.
We can clearly rule out two physical CPUs. From the info in the first post, it is probably hyperthreading, maybe dual-core, certainly not two physical CPUs.

Last edited by johnsfine; 06-29-2009 at 10:29 AM.
 
Old 06-29-2009, 10:34 AM   #7
manojg
Member
 
Registered: May 2004
Posts: 78

Original Poster
Rep: Reputation: 15
Thanks a lot for your quick reply. Actually, I was confused with different outputs. In one of my computer, I got following outputs:

1) /proc/cpuinfo shows two processors.

processor : 0
physical id : 0
siblings : 2

processor : 1
physical id : 3
siblings : 2


2) /usr/sbin/lshw shows two logical processors.

*-logicalcpu:0
description: Logical CPU
physical id: 0.1
width: 32 bits
capabilities: logical

*-logicalcpu:1
description: Logical CPU
physical id: 0.2
width: 32 bits
capabilities: logical

This means it has only one cpu, with HT

3)/usr/sbin/dmidecode shows two processors entries.

Processor Information
Socket Designation: X1
Type: Central Processor
Family: Pentium 4
Manufacturer: Intel

Processor Information
Socket Designation: X2
Type: Central Processor
Family: Pentium 4
Manufacturer: Intel

I am not what should I conclude from these information.

Also, there is no core id in /proc/cpuinfo. But ht is there.
Thanks.

Last edited by manojg; 06-29-2009 at 10:36 AM.
 
Old 06-29-2009, 11:04 AM   #8
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
You sure have weird output from /proc/cpuinfo
How obsolete is your kernel?

Quote:
Originally Posted by manojg View Post
processor : 1
physical id : 3
siblings : 2
physical id 3 should mean this logical processor is in a different physical CPU from the one identified as physical id 0. The "3" itself has little meaning. Only the fact that it is different from the "0" has real meaning.

The siblings 2 should mean you have two logical processors in the same physical CPU. But you seem to be saying there are only two logical processors total and they are in different physical CPUs. Siblings does not distinguish between cores and hyperthreading. I thought for hyperthreading it required hyperthreading enabled. But maybe it also includes hyperthreading disabled so it all means you have two physical CPUs each of which could be two logical CPUs if you enabled hyperthreading, but currently you have disabled hyperthreading.

But maybe it all just means you have an obsolete kernel that puts incorrect information in /proc/cpuinfo

Last edited by johnsfine; 06-29-2009 at 11:07 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Determining Number of Physical CPU sagarparadkar Solaris / OpenSolaris 4 01-12-2009 10:08 PM
Tweaking CPU Load and number of CPUs cabron Linux - Newbie 3 12-18-2007 09:59 AM
Intel DG33FB motherboard - cannot run second core on cpu (core 2 duo) rmitev Linux - Enterprise 2 09-28-2007 04:54 AM
how to find number of cores in CPU narensr Linux - Hardware 5 08-24-2006 01:09 PM
Get CPU Usage as a number 3saul Linux - Software 1 01-06-2006 01:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration