How does VB handle Hyperthreading?
-
ToddAndMargo
- Posts: 306
- Joined: 6. Aug 2007, 02:24
How does VB handle Hyperthreading?
Hi All,
How does Virtual Box handle multiple hyperthreaded cores?
I have an x5650 processor with 6 real cores that presents itself to my OS as 12 virtual cores (hyperthreading). Hyperthreading can not be turned off in the BIOS.
Does Virtual Box see 6 or 12 cores?
My big concern here is that if I tell Virtual Box to use 4 cores on my x5650, will I get 4 hyperthreaded cores for a total of 2 actual/real cores?
Or if I ask for four cores, will I actually get four actual/real cores?
Many thanks,
-T
How does Virtual Box handle multiple hyperthreaded cores?
I have an x5650 processor with 6 real cores that presents itself to my OS as 12 virtual cores (hyperthreading). Hyperthreading can not be turned off in the BIOS.
Does Virtual Box see 6 or 12 cores?
My big concern here is that if I tell Virtual Box to use 4 cores on my x5650, will I get 4 hyperthreaded cores for a total of 2 actual/real cores?
Or if I ask for four cores, will I actually get four actual/real cores?
Many thanks,
-T
-
Sasquatch
- Volunteer
- Posts: 17798
- Joined: 17. Mar 2008, 13:41
- Primary OS: Debian other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows XP, Windows 7, Linux
- Location: /dev/random
Re: How does VB handle Hyperthreading?
VB handles the cores by asking the Host OS for it. The Host then allocates the resources. If you read more about Hyperthreading, you will know what it does and what it means.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
-
ToddAndMargo
- Posts: 306
- Joined: 6. Aug 2007, 02:24
Re: How does VB handle Hyperthreading?
And I have no idea what you just said. :'[Sasquatch wrote:VB handles the cores by asking the Host OS for it. The Host then allocates the resources. If you read more about Hyperthreading, you will know what it does and what it means.
-
kebabbert
- Volunteer
- Posts: 321
- Joined: 31. May 2008, 10:00
- Primary OS: OpenSolaris 11
- VBox Version: OSE other
- Guest OSses: WinXP, RedHat, Ubuntu
Re: How does VB handle Hyperthreading?
Then maybe you should not concern about hyper threading? 
It seems that VirtualBox asks the hardware about cores. Read the manual?
It seems that VirtualBox asks the hardware about cores. Read the manual?
-
ToddAndMargo
- Posts: 306
- Joined: 6. Aug 2007, 02:24
Re: How does VB handle Hyperthreading?
kebabbert wrote:It seems that VirtualBox asks the hardware about cores.
And does VirtualBox get told 6 or 12 cores?
Does VirtualBox even know the difference?
Not in the manual.Read the manual?
To re-ask my question: if I tell Virtual Box to use 4 cores on my x5650, will I get 4 hyperthreaded cores for a total of 2 actual/real cores? Or if I ask for four cores, will I actually get four actual/real cores?
-
fixedwheel
- Volunteer
- Posts: 1699
- Joined: 13. Sep 2008, 02:18
Re: How does VB handle Hyperthreading?
yesToddAndMargo wrote:if I tell Virtual Box to use 4 cores on my x5650, will I get 4 hyperthreaded cores
no, you can not tell, its handled by the host OS like that: VBox starts another quite ordinary process for each additional virtual CPU you assign... for a total of 2 actual/real cores? Or if I ask for four cores, will I actually get four actual/real cores?
-
Sasquatch
- Volunteer
- Posts: 17798
- Joined: 17. Mar 2008, 13:41
- Primary OS: Debian other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows XP, Windows 7, Linux
- Location: /dev/random
Re: How does VB handle Hyperthreading?
Actually, no. You don't get hyperthreaded cores. You get separate cores. If you assign 2 cores to VB and it happens to be one physical core split in two due to the hyperthreading, then so be it.fixedwheel wrote:yesToddAndMargo wrote:if I tell Virtual Box to use 4 cores on my x5650, will I get 4 hyperthreaded cores
If you would get a hyperthreaded core, you would get on the Guest what you have on the Host. One physical cores with two virtual ones. Not the case with VB.
Of course, if that was the question, then yes is the correct answer
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
-
ToddAndMargo
- Posts: 306
- Joined: 6. Aug 2007, 02:24
Re: How does VB handle Hyperthreading?
By any chance, are the guest's core not actually linked to the physical cores on the host? Rather, are they made up (fake) cores like everything else on the guest (video, network, hard drive, PCI controllers, etc.)?fixedwheel wrote:yesToddAndMargo wrote:if I tell Virtual Box to use 4 cores on my x5650, will I get 4 hyperthreaded cores
no, you can not tell, its handled by the host OS like that: VBox starts another quite ordinary process for each additional virtual CPU you assign... for a total of 2 actual/real cores? Or if I ask for four cores, will I actually get four actual/real cores?
In which case, does a guest core just correspond to a "Program" (or "processes" if you wish) on the host? Also in which case, can you have any number of "fake" cores on the guest as long as the host has the chops to handle it? And are the "fake" cores just single cores emulating a core with only one pipe (not two, like hyperthreading)?
If so, with 6 real cores and 12 hyperthreaded cores on my motherboard (hyperthreading can not be turned off in BIOS), how many cores would you assign to the guest? 4 or 10? (Must be an even number of cores or M$ programs like M$SQL will lay an egg.)
Is there a "best practice" rule to follow when assigning hyperthreaded cores to a guest?
Sorry for being so thick headed here. I will get this eventually.
Many thanks,
-T
-
ToddAndMargo
- Posts: 306
- Joined: 6. Aug 2007, 02:24
Re: How does VB handle Hyperthreading?
Sasquatch,Sasquatch wrote:Actually, no. You don't get hyperthreaded cores. You get separate cores. If you assign 2 cores to VB and it happens to be one physical core split in two due to the hyperthreading, then so be it.fixedwheel wrote:yesToddAndMargo wrote:if I tell Virtual Box to use 4 cores on my x5650, will I get 4 hyperthreaded cores
If you would get a hyperthreaded core, you would get on the Guest what you have on the Host. One physical cores with two virtual ones. Not the case with VB.
Of course, if that was the question, then yes is the correct answer.
I still have no idea what you are saying. It is embarrassing! Would you please lower the technical level a notch so that a beginner can grasp what you are saying? (Tie half your brain behind your back.)
Is the guest seeing an actual core or just a fake process emulating a core?
Many thanks,
-T
-
Sasquatch
- Volunteer
- Posts: 17798
- Joined: 17. Mar 2008, 13:41
- Primary OS: Debian other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows XP, Windows 7, Linux
- Location: /dev/random
Re: How does VB handle Hyperthreading?
The Guest gets a real core, but the Host decides which it gets. The load gets balanced between all the cores, so it can run on core 1 for two seconds, and then run on core 3 a second later. The load is distributed over the HT pipes too, so you don't always get the first pipe to the core, sometimes you get the second. But I've yet to see a VM getting both pipes to just one core when it's set to have 2 cores. I think that is impossible due to the nature of how HT works, but I've been proven wrong on more than one occasion.
I do have a bad habit of writing things down the way I see them, which makes no sense at all for others. Makes it hard to see what is hard to understand. I hope I made sense to you with this post.
I do have a bad habit of writing things down the way I see them, which makes no sense at all for others. Makes it hard to see what is hard to understand. I hope I made sense to you with this post.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
-
ToddAndMargo
- Posts: 306
- Joined: 6. Aug 2007, 02:24
Re: How does VB handle Hyperthreading?
Okay, so the guest is just another program to the host. And, the host OS does the load balancing.Sasquatch wrote:The Guest gets a real core, but the Host decides which it gets. The load gets balanced between all the cores, so it can run on core 1 for two seconds, and then run on core 3 a second later. The load is distributed over the HT pipes too, so you don't always get the first pipe to the core, sometimes you get the second. But I've yet to see a VM getting both pipes to just one core when it's set to have 2 cores. I think that is impossible due to the nature of how HT works, but I've been proven wrong on more than one occasion.
Do you have a rule of thumb as to how many core to assign to a guest? For instance, with an Intel x5650 with 6 real and 12 hyperthreaded cores, how many cores would you assign to the guest?
Many thanks,
-T
No problem. You are doing fine. I am thicker than cement on this question.I do have a bad habit of writing things down the way I see them, which makes no sense at all for others. Makes it hard to see what is hard to understand. I hope I made sense to you with this post.
-
crash0veride
- Posts: 43
- Joined: 23. Apr 2009, 22:29
- Primary OS: Linux other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: WinXP, Win 7, Windows Server 2008 R2, SL 6, OEL 6, FC 15
- Location: ThE MaTriX
Re: How does VB handle Hyperthreading?
See My thread on Intel SMT and VBox:
Intel SMT
Intel SMT
-
Sasquatch
- Volunteer
- Posts: 17798
- Joined: 17. Mar 2008, 13:41
- Primary OS: Debian other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows XP, Windows 7, Linux
- Location: /dev/random
Re: How does VB handle Hyperthreading?
Basic rule for core assignment is to leave one for the Host so that VMs can never lock up the host. So with a hexacore CPU, it would be 5 cores tops.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
-
ToddAndMargo
- Posts: 306
- Joined: 6. Aug 2007, 02:24
Re: How does VB handle Hyperthreading?
Thank you!Sasquatch wrote:Basic rule for core assignment is to leave one for the Host so that VMs can never lock up the host. So with a hexacore CPU, it would be 5 cores tops.
So, just ignore the hyperthread. Also, use an even number of multiple cores, if you are using any M$ software on the guest that freaks out over odd numbers of processors, such as MSQL server
-T
-
Sasquatch
- Volunteer
- Posts: 17798
- Joined: 17. Mar 2008, 13:41
- Primary OS: Debian other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows XP, Windows 7, Linux
- Location: /dev/random
Re: How does VB handle Hyperthreading?
The assignment of cores also counts for the amount of VMs you can safely start without having to worry about a possible compromise of the Host resources. With 5 cores at your disposal, you can start 5 VMs with single core or 2 VMs with 2 cores and 1 with 1 core, etc.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.