VirtualBox

Ticket #4392 (reopened defect)

Opened 5 months ago

Last modified 10 hours ago

Huge IO-APIC/guest SMP overhead with 32 bits guests

Reported by: rafael_chang Assigned to:
Priority: major Component: VMM/HWACCM
Version: VirtualBox 3.0.6 Keywords:
Cc: Guest type: other
Host type: other

Description (Last modified by sandervl73)

Symptoms are high CPU usage while running e.g. 32 bits Windows XP/2000 guests with IO-APIC enabled.

Current status:

  • fixed for AMD-V in VirtualBox 3.0.6 (requires 3.0.6 guest additions to be installed)
  • fixed for VT-x, but only if the Intel CPU supports 64 bits (leaves out Core Solo/Duo); fixed in SVN (Nov 3rd 2009)
  • Solaris/OpenSolaris guests have similar issues, but a kernel fix is underway.

Does not apply to:

  • 64 bits guests
  • 32 bits Windows Vista or Windows 7

Attachments

VBox.log (41.6 kB) - added by greerga on 2009-09-12 08:42:35.
Windows 2000 SMP under Ubuntu 9.0.4 64-bit VT-x

Change History

2009-07-04 13:47:06 changed by rafael_chang

noticed the following, if I disable the IOAPIC and set VCPU to 1, install goes fine and fast ...

2009-07-04 14:04:52 changed by sandervl73

  • summary changed from windows xp VM extremely slow when AMD-v is enable with 2 cpu to huge IO-APIC/guest SMP overhead with 32 bits guests (AMD-V only).

Known problem and mentioned in the manual. 32 bits guests are extremely slow with the IO-APIC enabled on AMD cpus. Will be fixed in a future release.

2009-07-17 01:00:54 changed by mike.merrett@bull.co.uk

I can confirm this behavior on 3.0.2 on AMD Phenom, Mandriva 2009.1. I can also confirm that changing the HAL on the guest VM to Advanced Configuration and Power Interface (ACPI) PC, changing the VM properties to disable IO-APIC, single vCPU. The guest then runs quickly and without problems - but of course, single vCPU. Is there any roadmap for a fix?

The exact same VM runs fine with multiple vCPU and IOAPIC on Intel VT-x, what's the problem with AMD-V ?

2009-07-17 09:13:39 changed by sandervl73

It's being worked on. Intel provides an optimization feature for APIC TPR access. AMD does not, so I have fix it myself.

2009-07-28 17:35:44 changed by mike.merrett@bull.co.uk

Similar statements also apply to VMs running Standard PC HAL compared with MPS Multiprocessor HAL. Switching to Standard speeds it up very much with the IOAPIC turned off in the VM settings.

Do we have a possible timeline for a fix, either a whole new version of VB3 incorporating AMD-friendly technology, or a patch to 3.0.2 ?

2009-08-18 11:46:48 changed by sandervl73

  • summary changed from huge IO-APIC/guest SMP overhead with 32 bits guests (AMD-V only) to huge IO-APIC/guest SMP overhead with 32 bits guests (AMD-V only) -> fixed in SVN/3.0.6.

Fixed in 3.0.6, but only after you've installed the 3.0.6 guest additions.

2009-09-10 08:24:51 changed by frank

  • status changed from new to closed.
  • resolution set to fixed.

2009-09-11 12:46:18 changed by mike.merrett@bull.co.uk

  • status changed from closed to reopened.
  • resolution deleted.

Thanks for the good work on this bug. I will be testing it as soon as I can get my hands on 3.0.6.

Can I please ask you to regression-test this fix against Windows XP 64-bit Edition on AMD-V [3.0.4 crashes when Nested Paging is on, machine occasionally aborts without warning or logging an error when Nested Paging is off]. Host is 32-bit Mandriva 2009 and 2008.

2009-09-12 08:42:35 changed by greerga

  • attachment VBox.log added.

Windows 2000 SMP under Ubuntu 9.0.4 64-bit VT-x

2009-09-12 08:43:48 changed by greerga

It's not AMD-V only; my VT-x does it too, even with 3.0.6 Guest Additions installed. (See attachment.)

Windows 2000 SMP with Ubuntu 9.0.4 64-bit VT-x.

2009-09-13 09:42:15 changed by sandervl73

  • version changed from VirtualBox 3.0.0 to VirtualBox 3.0.6.
  • description changed.
  • summary changed from huge IO-APIC/guest SMP overhead with 32 bits guests (AMD-V only) -> fixed in SVN/3.0.6 to Huge IO-APIC/guest SMP overhead with 32 bits guests.

mike: please don't mention unrelated problems in this defect. If you still see this xp64 abort with 3.0.6, then open another defect with a proper description and VBox.log.

greerga: your Intel CPU doesn't support the APIC access optimization. I intend to enable the same fix once we get more feedback about AMD-V.

(follow-up: ↓ 13 ) 2009-09-13 09:42:55 changed by sandervl73

  • description changed.

2009-09-25 11:44:09 changed by frank

  • component changed from other to VMM/HWACCM.

(in reply to: ↑ 11 ) 2009-10-02 17:10:22 changed by mike.merrett@bull.co.uk

Replying to sandervl73:Point taken about 64-bit, I will keep testing that and raise a new issue for it.

However... my testing of 3.0.6 with XP 32-bit on AMD-V has shown that it's better - and it's worse. It's better - when you choose a guest ACPI Multprocessor HAL or ACPI Uniprocessor HAL, it runs without taking half an hour to boot up and flatlining one or two CPU cores at 100%. Most of the time. However today it went back to behaving like the un-patched 3.0.4 problem. I fixed this by running sudo /etc/init.d/vboxdrv restart . Clearly something in the VirtualBox drivers can revert to the old behavior given some [unknown] circumstances.

If you build your guest with the Advanced Power Configuration Interface (ACPI) HAL [i.e. no IOAPIC, as was required on 3.0.4 to work], it runs, but not as quickly as it used to on 3.0.4. So the fix has crippled non-IOAPIC but has not completely raised the performance level of IOAPIC-based configurations.

The typical performance issue is that the SysInternals? Process Explorer is showing that System and Services.exe are together taking 6% or more all the time, even with dual 2.3GHz vCPUs. This is way short of physical machine performance. So the system has a performance draining wait loop somewhere inside it, meaning that activities like Windows Installer take far longer to complete than expected unless you intervene with Process Explorer and raise the process priority to "High".

It's a shame - this so nearly worked. The fact is that 3.0.4 with IOAPIC disabled and one vCPU massively outperforms 3.0.6 with dual vCPUs, which seems counter-intuitive.

Also I have had numerous aborts when Guest Additions 3D Acceleration is enabled.

2009-11-02 20:59:58 changed by ToddAndMargo

Just getting myself on the Cc: list (couldn't find another way). Just ignore.

2009-11-03 12:04:09 changed by sandervl73

  • description changed.

2009-11-03 12:27:52 changed by frank

  • description changed.

2009-11-03 15:33:25 changed by sandervl73

  • description changed.

2009-11-13 16:37:35 changed by ralf

I have exactly the described issue with VirtualBox 3.0.10, 32bit Kubuntu 9.04 host and 32bit Windows XP guest. My processor is a Core 2 Duo E6420 which does support 64bit. However, reading the "current status", I'm not sure what exactly is in SVN only - the fix for Intel processor supporting 64bit or the fix for those which don't.

2009-11-16 10:40:31 changed by frank

VBox 3.1.0 will contain a fix for Windows guests which works if the guest additions are installed and if the host CPU supports VT-x and 64-bit. I known, it sounds a bit strange that 64-bit support is required to workaround some 32-bit issue :)

2009-11-16 10:41:13 changed by frank

Well, the current status in the ticket description should be clear.

2009-11-16 20:53:24 changed by ralf

Ok, thanks for clarification - I hope for version 3.1 then :)

2009-11-17 18:55:38 changed by fuUser

Is there any plan/solution you are working on for 32 Bit Hosts? I use a (beloved) Pentium M Notebook with 2 GB Ram which can handled non-APIC VM's with acceptable speed (for office etc) but nearly grinds to hold and suffers huge delays when using an almost exactly configured VM, which was installed (and has to run) with APIC enabled. This causes a rather huge administrative burden for me, because I have to keep two Versions of practically the same VM updated and running. One for my 64 Bit Host(s) and one for my 32 Bit Host.

2009-11-19 18:52:57 changed by ralf

The 3.0.12 changelog says: VMM: reduced IO-APIC overhead for 32 bits Windows NT/2000/XP/2003 guests; requires 64 bits support (VT-x only; bug #4392) However, I still experience this issue after upgrading to the latest version.

2009-11-19 19:09:57 changed by frank

ralf: Please attach a VBox.log file of such a session.

2009-11-19 20:45:21 changed by sandervl73

ralf: you need to install the 3.0.12 additions and the OS type in the VM settings needs to be correct. The workaround is only enabled for 32 bits NT/2K/XP/2K3 OSes.

2009-11-19 22:16:42 changed by frank

Yes, that was the reason I was asking for the VBox.log file :)

2009-11-20 12:24:54 changed by ralf

The issue occurs long before I can even install the guest additions, during OS installation. I also have an old VM installed when there was no SMP, where I installed the 3.0.12 additions and after doing so copied the hal.dll and ntoskrnl.exe from a multiprocessor system. I will get you a logfile of that one ASAP. Do I have to re-install the additions after changing the HAL?

2009-11-20 13:22:36 changed by frank

The performance will not improve until you installed the guest additions and until they are active. That is, the fix/workaround will not work during boot.

I think it is not necessary to re-install the guest additions after you changed the HAL but it cannot hurt. Make sure to use 3.0.12 additions in any case.

2009-11-20 18:09:01 changed by ralf

Ok, I installed the new HAL and re-installed the latest guest additions. Then I started a new VirtualBox session (so the log file I'll attach soon starts here), started Windows, and indeed the "full load while doing nothing" vanished some time after the additions were loaded, so something improved. However, then I started Warcraft III (to test performance), and it is definitely slower than without IO-APIC (the sound stutters, and the animations are not fluent). I also have the impression that the task-manager process list still flickers a tiny bit, but it's nothing compared to how it behaves without the work-around. At least it's now able to play the Windows shut-down sound without stuttering (the start-up sound is of course still broken).

Any chance of a work-around which is independent of the guest doing some cooperation? In the current state, IO-APIC and SMP will stay disabled here. However, I obviously don't understand anything of the internals of this issue. Since I don't use the VM that often it's not a big deal. It'd just be nice to be able to use both cores. Anyway, keep up the good work, and thanks a lot for making such a great open-source VM :)

© 2009 Sun Microsystems, Inc.
ContactPrivacy policy