35

While I was learning about cpu load, I came to know that it depends on the number of cores. If I have 2 cores then load 2 will give 100% cpu utilization.

So I tried to find out cores.( I already know that system has 2 cores, 4 threads so 2 virtual cores Check here about processor).So I ran cat /proc/cpuinfo Which gave me

processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 69
model name  : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
stepping    : 1
microcode   : 0x17
cpu MHz     : 774.000
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 2
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
bogomips    : 3591.40
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 69
model name  : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
stepping    : 1
microcode   : 0x17
cpu MHz     : 1600.000
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 2
apicid      : 1
initial apicid  : 1
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
bogomips    : 3591.40
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

processor   : 2
vendor_id   : GenuineIntel
cpu family  : 6
model       : 69
model name  : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
stepping    : 1
microcode   : 0x17
cpu MHz     : 800.000
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 1
cpu cores   : 2
apicid      : 2
initial apicid  : 2
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
bogomips    : 3591.40
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

processor   : 3
vendor_id   : GenuineIntel
cpu family  : 6
model       : 69
model name  : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
stepping    : 1
microcode   : 0x17
cpu MHz     : 774.000
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 1
cpu cores   : 2
apicid      : 3
initial apicid  : 3
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
bogomips    : 3591.40
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

Now I am totally confused. It shows 4 processors, with 2 cpu cores. Can anyone explain this output?

Once my cpu load was 3.70, Is this maximum load? Still at that time cpu was at <50%.

What about turbo boost? Are all cores are turbo boosted or only physical?

Any method in Ubuntu to get current cpu frequency to see if the processor is on turbo boost or not?

Load was to 3.70 about 100%. But CPU usage wasn't 100% because of IO response time. This does not means that IO device will be at maximum speed, but io device will be 100% busy, which sometimes affects applications using IO ex: music may break.

5
  • 2
    Hyper threading is why you see 4 instead of 2.
    – derobert
    Jul 23, 2014 at 7:48
  • 1
    Both documentation and cpuinfo tell you that you have two cpu cores. Processors 0 and 1 are on core 0 whereas processors 2 and 3 are on core 1 (look at the line core id). The physical id gives you the chip (I guess). Here, it's 0 for all processors, so you only have one chip.
    – lgeorget
    Jul 23, 2014 at 7:50
  • SO what is processor load to 100%...2 or 4 ? Jul 23, 2014 at 7:57
  • What is processor here ? Jul 23, 2014 at 7:58
  • Please note that Intel's definition of thread ("A Thread, or thread of execution, is a software term for the basic ordered sequence of instructions that can be passed through or processed by a single CPU core") may make one think that with 2 cores and 4 threads, as stated in the specs, 2x4=8 threads are running. In fact you have 4 threads in total and 2 cores look like 4. The definition of Intel® Hyper-Threading Technology is clearer: it "delivers two processing threads per physical core" and explains it better that your system sees 4 processors/siblings out of 2 cpu cores mounted one chip Dec 18, 2018 at 14:48

4 Answers 4

47

The words “CPU”, “processor” and “core” are used in somewhat confusing ways. They refer to the processor architecture. A core is the smallest independent unit that implements a general-purpose processor; a processor is an assemblage of cores (on some ARM systems, a processor is an assemblage of clusters which themselves are assemblages of cores). A chip can contain one or more processors (x86 chips contain a single processor, in this sense of the word processor).

Hyperthreading means that some parts of a core are duplicated. A core with hyperthreading is sometimes presented as an assemblage of two “virtual cores” — meaning not that each core is virtual, but that the plural is virtual because these are not actually separate cores and they will sometimes have to wait while the other core is making use of a shared part.

As far as software is concerned, there is only one concept that's useful almost everywhere: the notion of parallel threads of execution. So in most software manuals, the terms CPU and processor are used to mean any one piece of hardware that executes program code. In hardware terms, this means one core, or one virtual core with hyperthreading.

Thus top shows you 4 CPUs, because you can have 4 threads executing at the same time. /proc/cpuinfo has 4 entries, one for each CPU (in that sense). The processor numbers (which are the number of the cpuNUMBER entries in /sys/devices/system/cpu) correspond to these 4 threads.

/proc/cpuinfo is one of the few places where you get information about what hardware implements these threads of execution:

physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 2

means that cpu0 is one of 4 threads inside physical component (processor) number 0, and that's in core 0 among 2 in this processor.

4
  • Nice explanation you left 3 questions Once my cpu load was 3.70, Is this maximum load? Still at that time cpu was at <50%., What about turbo boost ? Are all cores are turbo boosted or only physical ? & How to check frequency. Jul 24, 2014 at 2:16
  • @MADTerry Which program reported that the “cpu load was 3.70”, in what terms exactly? Do you mean the load average? What do you mean by “cpu was at <50%”? Regarding Turbo Boost, I'm not familiar with that, but I don't see why they wouldn't all be boosted. All cores are physical, unless you're running in a virtual machine: as I explain in my answer, in “virtual cores”, it isn't the cores that are virtual, it's their separation. Jul 24, 2014 at 7:42
  • average load. uptime.by cpu i meant cpu usage.i understood why. But how to check frequency or check if cpu is turbo boosted ? Jul 25, 2014 at 4:58
  • I would also argue that, in terms of high-level software, you are rather interested in processes (see top, uptime). Which hardware unit deals with processes is ultimately matter of low-level software (compilation, operating system). The cpuinfo report abstracts out the fact that each physical processor (one of several cpu's on a die) can expand its computing powers by tech feats such as multithreading. It will regard 'anything' that can take care of one process at a time as a processor. In cpuinfo's accounting eye, the device capabilities do lead to the total count of "processors" Dec 18, 2018 at 15:15
13

Just answering your first question. In the output of cat /proc/cpuinfo you can see the following information:-

physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 2

You can see the count of siblings is 4 and cpu cores is 2. cpu cores being 2 is that total number of cores in the processor which can be checked from the spec given in the intel's URL you have given. Similarly siblings is the one determined by number of threads which is provided by intel's HTT.

Similarly, for physical id its 0 which indicates there is only one processor chip and for core ids you can see 0 and 1 that is 2 cores in the processor.

Update: Adding answers to the other questions.

What about turbo boost ? Are all cores are turbo boosted or only physical ?

Well I'll say, all active cores are turbo-boosted. Hey buddy, you should have checked out the examples by our beloved Wikipedia . Explained with calculations too.

Any method in ubuntu to get current cpu freq. if processor is on turbo boost or not.

Turbo boost or not you can the freq details in the output of lscpu . And for a refined output:-

lscpu | grep Hz
2
  • Short & quick answer but can you explain remaining 3 ? Jul 24, 2014 at 2:19
  • @MADTerry thanks but the others I am not clear, will do some research and edit my answer. Meanwhile lets see if someone else pops-in.
    – beginer
    Jul 24, 2014 at 3:38
10

You can try this in terminal:

sudo lscpu

This will give you an overview of your cpu physical trait. As for turbo boost or not, this is purely hardware control than the OS itself, so unless Intel has a specific drivers for Linux that can tune your processor speed, there's no solid lead to check the turbo boost state (unless there's a command code for it. Check other forums if there are any clues regarding your question).

As for me, this is what I get when I type the above command. My AMD said it is quad core, but my physical core listed over here is only 2, with 2 threads per core (adds up to 4 cores). I'm using AMD A10 APU processor 5750m.

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    2
Core(s) per socket:    2
Socket(s):             1
NUMA node(s):          1
Vendor ID:             AuthenticAMD
CPU family:            21
Model:                 19
Stepping:              1
CPU MHz:               2500.000
BogoMIPS:              4990.51
Virtualization:        AMD-V
L1d cache:             16K
L1i cache:             64K
L2 cache:              2048K
NUMA node0 CPU(s):     0-3
0

System load and cpu% are two different ways to measure how your cpu power is used.

  • system load: how many processes per cpu have been in "ready" state - averaged over some time. Up to 1*cpu (in your case up to 4) the system is regarded as nearly idle (compare with a supermarket where on average only one customer is waiting at every checkout). You will probably not notice any lag up to 2*cpu (in your case 8).
  • cpu%: how much time the cpus do actual work by running a process. It's like the cashiers' point of view - or rather their supervisor's - they want them to be busy all the time.

Both measures are related but in no way identical.

2
  • i didnot asked the different. I already read it in articles. Anyway your answer contradicts Gilles answer. Jul 24, 2014 at 2:14
  • Where do you see a contradiction?
    – guntbert
    Jul 24, 2014 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.