FreeBSD does not use all cpus on top show.

Ivan Voras ivoras at fer.hr
Thu Sep 14 05:44:23 PDT 2006


Huang wen hui wrote:
> hi,
> I have HP Server install FreeBSD 6.1R/amd64 with 2CPUs ,2 logical CPUs
> per core.
> On top show, It should show 4 cpus, but I never see 1 and 3 cpu on show.
> Does anything I miss?

This is a simplified version of things, but it will help you: CPUs 0 and 
2 are "real" CPUs, while 1 and 3 are additional hyperthreaded 
"counterparts" of those. Since hyperthreading is disabled in FreeBSD by 
default (because it generally doesn't help performance and has a sort-of 
security hole in the hardware itself), processes are never scheduled to 
run on CPUs 1 and 3.

You can either disable hyperthreading in BIOS, so you'll have only CPUs 
0 and 1, or enable hyperthreading in FreeBSD with 
machdep.hyperthreading_allowed=1 sysctl, which will enable you to use 
all 4 logical CPUs.



More information about the freebsd-stable mailing list