Does smp support mean guests use more than 1 host core?

Postings relating to old VirtualBox pre-releases
Post Reply
ljw1
Posts: 41
Joined: 26. Apr 2009, 10:35
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: Ubuntu

Does smp support mean guests use more than 1 host core?

Post by ljw1 »

Does smp support mean guests use more than 1 host core?

On my opensolaris box all of the hosts use 100% of a single core in v2.2.4, which means that certain things like hd video decoding sometimes struggle. So if both cores were exposed to the vm then that would be awesome as my host is basically idleand the extra cycles would make the vm's more usable.

Anybody?
frank
Oracle Corporation
Posts: 3362
Joined: 7. Jun 2007, 09:11
Primary OS: Debian Sid
VBox Version: PUEL
Guest OSses: Linux, Windows
Location: Dresden, Germany
Contact:

Re: Does smp support mean guests use more than 1 host core?

Post by frank »

Guest SMP support means to provide support for multiple virtual CPUs to the guest, that is the guest thinks it runs on more than one CPU. The ideal case is that the guest can make use of more than one (virtual) CPU, for instance when compiling big projects in parallel make jobs. Such jobs are primary CPU-bound.

Of course support for more than one guest CPU does not make sense if you only have one CPU at your host but almost every new computer has 2 or 4 builtin cores.

Apart from this, VirtualBox is multithreaded from the beginning, so even older versions benefit from multiple host CPUs, for instance for I/O-related tasks. Networking should be notably faster with 2 host cores than with one host core.

Finally, if your host CPU is loaded at 100% then this is either a misbehavior of your guest or a bug of VirtualBox.
ljw1
Posts: 41
Joined: 26. Apr 2009, 10:35
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Does smp support mean guests use more than 1 host core?

Post by ljw1 »

On the host the cpu usage maxes out one of the cores( of which there are two), on the guest it reports that the cpu is maxed out. I will have to check where the io tasks are separated from the main vbox thread for 2.2.4.
frank
Oracle Corporation
Posts: 3362
Joined: 7. Jun 2007, 09:11
Primary OS: Debian Sid
VBox Version: PUEL
Guest OSses: Linux, Windows
Location: Dresden, Germany
Contact:

Re: Does smp support mean guests use more than 1 host core?

Post by frank »

So if the guest CPU load is at 100%, which guest task is burning CPU cycles?
ljw1
Posts: 41
Joined: 26. Apr 2009, 10:35
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Does smp support mean guests use more than 1 host core?

Post by ljw1 »

The guest is using the cpu to decode 1080p video, which requires a lot of processing power. So the response of the guest is normal. What I was hoping was that the host would allow use of all the cores by the guests, so if one guest is idle most of the time then the other guest that requires cpu time has the ability to use all of the host cores available.
frank
Oracle Corporation
Posts: 3362
Joined: 7. Jun 2007, 09:11
Primary OS: Debian Sid
VBox Version: PUEL
Guest OSses: Linux, Windows
Location: Dresden, Germany
Contact:

Re: Does smp support mean guests use more than 1 host core?

Post by frank »

First, each VM process, that is, each guest, runs in its own process. One process has one or more threads. Therefore two VMs started on a dual core host will run notably faster than on a single core host. If you start two VMs and one VM is idle, the other VM will benefit from that fact because it can use the additional CPU time either for the direct emulation of the guest CPUs or for I/O tasks, for instance for networking.

If your encoder is multi-threaded it will benefit if the VMM can provide more than one guest CPU core. Otherwise there is no true parallelism in the guest.
Post Reply