The following data is the result of a series of tests comparing performance of an SMP kernel with HyperThreading enabled (machdep.hyperthreading_allowed=1) versus a non-SMP kernel resembling GENERIC (minus built-in support for a few cards) on a single-core Xeon.
The test box is a Dell PowerEdge SC1425 with 1GB of RAM with an Intel Xeon 2.8GHz processor running FreeBSD 6.1-RELEASE-p10.
The preformatted text before each table gives an idea of the command that generated the data. The tests (other than buildkernel) were done using sysbench 0.4.8. I've never used the program before so I can't vouch for its accuracy.
# rm -rf /usr/obj/usr/src/sys/ # time env -i make -jXX buildkernel KERNCONF=ALVIS
| real | user | sys | |
| -j2 (SMP) | 11:52.60 | 18:20.81 | 01:51.07 |
| -j2 | 13:31.32 | 11:45.43 | 01:30.69 |
| -j4 (SMP) | 11:43.61 | 18:07.96 | 01:56.37 |
| -j4 | 13:31.95 | 11:50.68 | 01:32.21 |
# sysbench --test=cpu --num-threads=XX run
| Total Event Time (s) | ||||
| Threads | Normal | SMP+HTT | Change | |
| TRIAL 1 | 1 | 55.1678 | 55.1733 | 0% |
| 5 | 275.7409 | 218.264 | -20.80% | |
| 10 | 556.5996 | 435.8256 | -21.7% | |
| TRIAL 2 | 1 | 55.2194 | 55.1258 | -0.10% |
| 5 | 275.8694 | 218.2093 | -20.90% | |
| 10 | 551.7829 | 436.0049 | -21.00% | |
# sysbench --test=memory --memory-total-size=10G --num-threads=XX run
| Total Event Time (s) | Operations/sec | Rate (MB/s) | |||||
| Threads | Normal | SMP+HTT | Normal | SMP+HTT | Normal | SMP+HTT | |
| TRIAL 1 | 1 | 51.5733 | 51.9178 | 147992.47 | 146781.08 | 144.52 | 143.34 |
| 2 | 104.3083 | 70.4953 | 147453.09 | 218100.46 | 144 | 212.99 | |
| 4 | 206.3408 | 137.1053 | 145875.86 | 219819.52 | 142.46 | 214.67 | |
| 8 | 392.3044 | 258.2406 | 147359.85 | 219601.62 | 143.91 | 214.45 | |
| TRIAL 2 | 1 | 51.0001 | 52.0631 | 148204.53 | 145734.67 | 144.73 | 142.32 |
| 2 | 104.0735 | 69.9713 | 147436.35 | 220046.93 | 143.98 | 214.89 | |
| 4 | 208.3495 | 137.1801 | 146383.1 | 219867.61 | 142.95 | 214.71 | |
| 8 | 394.3918 | 256.6188 | 147236.78 | 219649.53 | 143.79 | 214.5 | |
The above test by sysbench is a test of writing (default) 10GB (default=100GB) to sequential memory (default) with memory block sizes of 1K (default).
It is clear that with multiple threads, the HyperThreading/SMP wins out by a lot, with rate increases of up to 50%! However, when the application uses a single thread, there is a measurable loss using SMP+HTT, and the non-SMP kernel performs best (but not by much).
The graphs below were generated using data from TRIAL 1.


