Linux - EnterpriseThis forum is for all items relating to using Linux in the Enterprise.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
This should output something like this:
processor : 0
core id : 0
cpu cores : 2
processor : 1
core id : 0
cpu cores : 2
processor : 2
core id : 0
cpu cores : 2
processor : 3
core id : 0
cpu cores : 2
processor : 4
core id : 1
cpu cores : 2
processor : 5
core id : 1
cpu cores : 2
processor : 6
core id : 1
cpu cores : 2
processor : 7
core id : 1
cpu cores : 2
The processor number is an increment of the total number of cores on the system - since I have 0 through 7 it tells me I have 8 cores.
Since the cpu cores tells me I have 2 I know each of my processors is actually dual core. Unfortunately the second core of each processor shows up as if it were a new processor (that is to say core ID 1 on each of processor's 4 through 7 are actually the second cores on each of processor's 0 through 3 (which each show core ID 0).
All of this lets me know I have 4 dual core processors for a total of 8 cores.
By the way dmidecode command will give you a lot more information about things. If in doubt you can always search for the processor model at the vendor's site to see what its specs are.
I checked two of the Linux Machines and in both of them "core id" is missing from /proc/cpuinfo.
Any idea, why is it so ? Any alternative to find "core id"
Please see the below logs
Code:
-sh-3.00$ cat /etc/redhat-release
Red Hat Enterprise Linux ES release 4 (Nahant Update 6)
-sh-3.00$
-sh-3.00$ egrep "^processor|^cpu cores|^core id" /proc/cpuinfo
processor : 0
processor : 1
-sh-3.00$
AND
Code:
[root@server ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5 (Tikanga)
[root@server ~]#
[root@server ~]# egrep "^processor|^cpu cores|^core id" /proc/cpuinfo
processor : 0
[root@server ~]#
If they are single core CPUs then you wouldn't see core ID for them as there is no need to differentiate.
For example I have an older Dell PE 2450 with two single core processors that shows:
egrep "^processor|^cpu cores|^core id" /proc/cpuinfo
processor : 0
processor : 1
Whereas on a newer much larger server with several multicore CPUs I see:
egrep "^processor|^cpu cores|^core id" /proc/cpuinfo
processor : 0
core id : 0
cpu cores : 4
processor : 1
core id : 0
cpu cores : 4
processor : 2
core id : 1
cpu cores : 4
processor : 3
core id : 1
cpu cores : 4
processor : 4
core id : 2
cpu cores : 4
processor : 5
core id : 2
cpu cores : 4
processor : 6
core id : 3
cpu cores : 4
processor : 7
core id : 3
cpu cores : 4
processor : 8
core id : 0
cpu cores : 4
processor : 9
core id : 0
cpu cores : 4
processor : 10
core id : 1
cpu cores : 4
processor : 11
core id : 1
cpu cores : 4
processor : 12
core id : 2
cpu cores : 4
processor : 13
core id : 2
cpu cores : 4
processor : 14
core id : 3
cpu cores : 4
processor : 15
core id : 3
cpu cores : 4
Also after my post last year I've since found the reason for additional CPUs being reported on some servers is due to hyperthreading being enabled. When it is you'll see twice as many processors as you actually have.
As mentioned previously if you use dmidecode to get exact CPU info you may be able to determine from manufacturer's web site what the characteristics (number of cores etc...) are for that model. However, I have noticed Intel seems to have removed a lot of info on older processors.
Last edited by MensaWater; 05-14-2010 at 07:49 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.