i7-3930K: VirtualBox slow with Hyper-Threading enabled

Greetings everyone,

VirtualBox has always been slow on my FreeBSD server and I never put much thought into it until I set up FreeBSD on my desktop and VirtualBox was much faster. This made me wonder if it was the hardware or software. I put the desktop SSD in the server and VirtualBox was fast. This confirmed it was the hardware.

After trying many BIOS options I determined the Hyper-Threading option was causing the slowness. When it's enabled, VirtualBox was very slow. Disabled, VirtualBox was fast. To quantify the slowness, it took 3:37 minutes to boot with Hyper-Threading enabled compared to 0:27 seconds with Hyper-Threading disabled. The virtual machine is a clean install of CentOS 64-bit and the drive image is less than 4 GB.

Not content thinking the hardware is at fault, I installed Linux Mint and, low and behold, VirtualBox was fast. The server has a 6-core i7-3930K. Does anyone know of any issues with FreeBSD and the i7-3930K or similar (6-core) CPUs? How can I troubleshoot this? Could this be fixed in FreeBSD 10? When I have time, I'll post the VirtualBox logs.

CPU: Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz
Motherboard: ASRock X79 Extreme9

Code:
uname -a
FreeBSD localhost 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec  4 09:23:10 UTC 2012     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
 
I can hardly imagine why it can affect VirtualBox so much. I think in worst case hyper-threading may cause ineffective scheduling (putting two task on the same physical core) that may reduce performance by 40%, but definitely not 8 times as you've shown!

With some of SCHED_ULE improvements before FreeBSD 9.1-RELEASE I was able to get from hyper-threading enabled results at least no worse than with disabled on all tests I've tried. Though I am not using VirtualBox.

BTW, what was the configuration of your virtual machine? How many virtual CPUs have you specified in the VM?
 
Back
Top