Number of processors in /proc/cpuinfo

  • 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.

    Hyper threading is why you see 4 instead of 2.

    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.

    SO what is processor load to 100%...2 or 4 ?

    What is processor here ?

    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

  • 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.

    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.`

    @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.

    average load. `uptime`.by cpu i meant cpu usage.i understood why. But how to check frequency or check if cpu is turbo boosted ?

    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"

License under CC-BY-SA with attribution


Content dated before 6/26/2020 9:53 AM