13

I understand that Σ(%CPU) ≤ logicalcores*(1+ε) (where ε is measure and rounding error). But, how can I have on a 2 core system 2 different processes, each taking 200% of CPU (as measured by htop)?

EDIT Cores in above equation means logical cores i.e. taking into account all hyperthreading, number of CPUs etc.

EDIT 2 Despite htop displays the number of processors I attach cpuinfo

processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 23
model name  : Intel(R) Core(TM)2 Duo CPU     T9600  @ 2.80GHz
stepping    : 10
cpu MHz     : 800.000
cache size  : 6144 KB
physical id : 0
siblings    : 2
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 lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm ida dts tpr_shadow vnmi flexpriority
bogomips    : 5585.20
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 23
model name  : Intel(R) Core(TM)2 Duo CPU     T9600  @ 2.80GHz
stepping    : 10
cpu MHz     : 800.000
cache size  : 6144 KB
physical id : 0
siblings    : 2
core id     : 1
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 lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm ida dts tpr_shadow vnmi flexpriority
bogomips    : 5586.38
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:
4
  • Is this reported this way on top as well? If so, what happens when you toggle between "Irix mode" and "Solaris mode" (use the I key to toggle between the two)?
    – Steven D
    Jan 13, 2011 at 1:01
  • @Steven D: I'll check when it'll have next time (probably soon). Jan 13, 2011 at 1:46
  • 1
    cat /proc/cpuinfo > /dev/unix.SE
    – SamB
    Jan 13, 2011 at 20:41
  • @Steven D: I was able to reproduce extra ~15% in Irix mode (adding 2 processes - it seems still a bit too much for rounding errors). I was not able to reproduce it in Solaris mode so far. Jan 14, 2011 at 2:53

3 Answers 3

5

Two dual-core processors contain 4 CPUs. Multi-threaded processors also exist. Each thread appears as a CPU to the OS, although they are not true CPUs as are cores. Most usually multi-threaded CPUs have two threads per core, so you can have a single, dual-threaded, dual-core processor that appears to your OS at 4 CPUs.

It should be noted that Sun Microsystems had a T2 chip which had 8 cores and 8 threads per core for 64 virtual CPUs on a single processor.

3
  • It is single processor, dual core, underclocked by cpufreq core 2 duo (mobile edition). There is no hyperthreading (it is in P4 and i3/5/7). Jan 12, 2011 at 21:30
  • 1
    It is worth checking if you see this on 'top' as well, or if this is a bug in 'htop'.
    – ewindisch
    Jan 12, 2011 at 21:55
  • 2
    check in /proc/cpuinfo - now much CPUs do u see there..
    – Drakosha
    Jan 13, 2011 at 17:51
5

A single physical hyperthreaded processor will appear as two logical processors. Thus your dual core processor in which each core is hyperthreaded will appear as four logical processors to things like top, cpuinfo, prstat, activity monitor, etc.

0

Do you have 2 processors or 4? If you have two cores with two CPUs each through hyperthreading, that's a total of four processors (as far as the OS is concerned).

1
  • I have 2 cores without hyperthreading. Even the turbo mode is disabled. Jan 12, 2011 at 21:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .