Port-i386 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Hyperthreading/SMT and NetBSD; how well does it work?




On Feb 8, 2009, at 4:37 , Matthias Scheler wrote:

On Thu, Feb 05, 2009 at 11:34:12AM -0500, Andreas Wrede wrote:
Atom 330 cpu and 2GB of memory running 5.0_RC1/amd64

build.sh -j 8 kernel=GENERIC run times:

With all 4 cpus:      8 min 41 sec
With 0 and 1 online: 11 min 07 sec
With 0 and 2 online: 16 min 23 sec
With only 0 online:  21 min 39 sec

Looks like HT gets us a 25% reduction in runtime.

I'm sorry but that is not a good test. A good test would be a build
with "-j 2" (yes, "two") with HT enabled and disabled.

As far as I know NetBSD's kernel doesn't know anything about HT/SMT.
So if you have a machine with four logical CPUs backed by two physical
CPUs (or CPU cores) there is a risk that the scheduler will use two
logical CPUs on the same physical CPU to handle to two jobs. And in
that case HT/SMT will slow down your system.


I have updated the numbers with -j 2 runs using time -l:

-j 2
all cpus online     1017.04 real      1192.59 user       144.58 sys
only 0 and 1 online  976.75 real      1151.81 user       142.44 sys
only 0 and 2 online 1138.57 real      1472.82 user       165.17 sys
only 0 online       1300.77 real      1147.25 user       150.20 sys

-j 8
all cpus online      523.49 real      1805.54 user       249.61 sys
only 0 and 1 online  668.53 real      1164.17 user       161.57 sys
only 0 and 2 online  986.12 real      1737.14 user       222.21 sys
only 0 online       1302.40 real      1147.13 user       151.98 sys

0 and 1 are the two Cores, 1 and 2 are their HTs.

Your scenario does indeed show up in the -j 2 case. Using both cores and their HTs is slower than just using the core.

--
    aew



Home | Main Index | Thread Index | Old Index