A question about Intel HyperThreading

Colin Percival cperciva at freebsd.org
Sun Sep 18 12:49:17 PDT 2005


Roger O. Svenning wrote:
> Due to a fatal hardware failure we replaced one of our AMD based
> NeverWinter Nights game -servers with an Intel Pentium 4 one running
> 6.0-beta4
> 
> Look at the top extract below and notice the 50% idle value.
> No matter what, it sits at 50% idle all the time when the nwserver
> process is running.
> 
> Neither have I ever seen top reporting any process using the other
> logical cpu, so basically it sits at 50% idle no matter how much load I
> throw at it.

Due to a widely-reported security problem, recent versions of FreeBSD
disable hyperthreading unless you set the machdep.hyperthreading_allowed
tunable in /boot/loader.conf.  What you're seeing is a consequence of
the mechanism which disables hyperthreading -- the "second thread" is
present but is forced to remain idle.

> The nwserver service is not multithreaded and I'm guessing it's using
> only one of the logical cpus, but are there actually processing power
> sitting idle here or is it just a top-weirdness?

There is a logical cpu sitting idle, but (due to the way hyperthreading
works) there isn't really any processing power sitting idle.

> Needless to say I want the nwserver process to be able to use all
> processing power available in the cpu.

If you want to maximize system performance, you should take SMP out of
your kernel configuration; it adds overhead without providing any benefit
on a single-processor system.

Colin Percival


More information about the freebsd-current mailing list