Virtuabox Performance issue in Raw mode - spin lock issues?

Discussions about using Linux guests in VirtualBox.
Post Reply
vthakkar
Posts: 14
Joined: 24. Nov 2015, 09:16

Virtuabox Performance issue in Raw mode - spin lock issues?

Post by vthakkar »

Hi,

I am running Virtualbox 5.0.12 on Windows host and running a linux guest with 1 VCPU. KVM provider is turned-on but in the particular case we have turned off the hardware virtualization extension (Intel VT-x) from BIOS. One of our target application is showing very bad load/launch time. I then profiled it using "perf" in linux and the perf profile shows a lot of samples in _raw_spin_unlock_irq() and pvclock_clocksource_read(). As per my understanding, the KVM provider in VBox5 paravirtualizes the SMP spin-locks and guest clock source reads. Would the paravirtualization I/F help in case we have disabled hardware virtualization?
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all
Contact:

Re: Virtuabox Performance issue in Raw mode - spin lock issues?

Post by michaln »

Raw mode performance will be much worse than VT-x on modern systems. There's no way around that, it's a hardware/architecture limitation.

The kvm spinlock optimizations only really apply to VMs with multiple VCPUs.
vthakkar
Posts: 14
Joined: 24. Nov 2015, 09:16

Re: Virtuabox Performance issue in Raw mode - spin lock issues?

Post by vthakkar »

Thanks for the reply. I did some profiling on the host side as well. In case of raw mode, a lot of time is spent in dispatching host interrupts. Do you think this is the reason for bad performance? I basically want to understand the reason for such a huge variation in performance b/w Raw mode and Virtualization enabled mode.
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all
Contact:

Re: Virtuabox Performance issue in Raw mode - spin lock issues?

Post by michaln »

You need to read up about x86 virtualization, it's not something that can be explained in a few sentences. Look at it this way -- Intel and AMD implemented hardware virtualization because it helps a lot.

As for "dispatching host interrupts" I don't know how you concluded that. Profiling across host OS / VM /guest OS is not trivial. The biggest performance killer with raw mode is probably shadow paging which unfortunately can't be avoided (except with hardware virtualization + nested paging).
Post Reply