Dual core CPU's, but only 2 CPU's in-use?

Kris Kennaway kris at FreeBSD.org
Mon Feb 25 10:30:14 UTC 2008


Tigger wrote:
> On Sun, 24 Feb 2008 15:59:49 +0100
> Kris Kennaway <kris at FreeBSD.org> wrote:
> 
>> Tigger wrote:
>>> On Sun, 24 Feb 2008 12:46:23 +0100
>>> Dominic Fandrey <kamikaze at bsdforen.de> wrote:
>>>
>>>> Tigger wrote:
>>>>> Hello. I have a Xeon system with 2 CPU's installed (dual-cores).
>>>>> Under FreeBSD 6.2, a systat reported 4 CPUs in use and so did
>>>>> dmesg. 
>>>>>
>>>>> Under FreeBSD 6.3, dmesg is reporting the 4 CPUs, but systat is
>>>>> only reporting 2 CPUs (CPU 0 and CPU 2). 
>>>>>
>>>>> How do I enabled the second cores on the CPU's or are they really
>>>>> running but systat is not reporting the CPU load across the cores?
>>>> You can run 'top -S' to check how many idle processes exist. If
>>>> there are four, everything is fine.
>>>>
>>>
>>> Sadly, no luck. Only cpu0 and cpu2 are reported:
>>>
>>>   PID USERNAME  THR PRI NICE   SIZE    RES STATE  C   TIME   WCPU
>>> COMMAND 11 root        1 171   52     0K     8K CPU2   2 143:43
>>> 92.38% idle: cpu2 13 root        1 171   52     0K     8K RUN    0
>>> 142:33 92.04% idle: cpu0
>> Are your CPUs really dual-core, or single core + hyperthreaded?
>>
>> Kris
>>
> 
> Thank you! Your email sent me off to do what I should have done first -
> some research. I assumed (wrongly) that 'Logical CPUs per core: 2'
> meant 'Dual Core', and when I saw the following:
> 
> FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
>  cpu0 (BSP): APIC ID:  0
>  cpu1 (AP): APIC ID:  1
>  cpu2 (AP): APIC ID:  6
>  cpu3 (AP): APIC ID:  7
> 
> I also thought 'Dual Core', however this is not the case. The CPU's
> are single core with Hyper Threading Tech.
> 
> But this research has also lead to some confusion. Its clear there are
> 2 CPU with 2 Logical cores each, but only 2 cores are in use - why?
> 
> Also, the 'man (4) smp' talks about (possible) performance issues with
> Hyper Threading enabled - does this mean I should set
> 'machdep.hlt_logical_cpus 1' (it is currently set to 0) - or because the
> Logical Cores are not being used I can forget about this?

hyperthreading is not enabled by default on 6.x.  See the security 
advisory for discussion and how to enable it.

Kris


More information about the freebsd-questions mailing list