10
3
I have a quad-core i7 processor with hyperthreading (8 logical cores), when I configured a virtual machine to use 8 processors, VirtualBox gave me a warning saying that I only have four cores (which is true) and that this may cause a performance issue. But hyper-threading is a hardware feature, so the OS sees 8 cores and it sends instructions to all 8. What if setting it to 4 caused the VM to use 2 cores (4 threads) instead of 4 simultaneous threads (on all 4 cores)? Does the warning I got take into account that my machine has hyper-threading?
Agreed. I was using 4 cores and found it only takes about 50% CPU time when building my project. Then in spite of the warning, I changed to 8 which is the number of the logical cores, the build was taking 100% CPU time and I believe it ran faster than before. – Deqing – 2016-09-06T04:28:55.127
This is quite interesting, I remember reading that Linux specifically tries to focus the load on 1 logical core from each physical HT core to increase efficiency. I wonder whether the guest Linux kernel gets to see that the CPU is hyper-threaded and optimize its scheduling for that type of configuration. – Anthony – 2018-10-02T13:19:22.140