Windows XP guest poor performance - clock_gettime [Solved]

Discussions related to using VirtualBox on Solaris hosts.
Post Reply
brainz
Posts: 6
Joined: 30. Dec 2015, 14:53

Windows XP guest poor performance - clock_gettime [Solved]

Post by brainz »

I am writing this in the hope that someone with a knowledge of the VirtualBox code will get a "I know what that is..." light bulb moment.

My XP VM (it's a long story) is hosted on Solaris 11.3 system, since building the performance of the VM has been poor. On investigation with prstat the single processor VM is taking 89% of cpu on a multi-core system, even when completely idle.

Code: Select all

$ VBoxManage --version
5.0.10r104061
Using dtrace to capture stacks and Brendan Gregg's excellent Flame Graphs (see attachment -.txt). I can see more than 50% of time is spent in the 'clock_gettime' procedure. The full stack trace which results in this can be seen in the flame graph.

The VM is defined as follows...

Code: Select all

$ VBoxManage list -l vms
Name:            XP-MediaServer
Groups:          /
Guest OS:        Windows XP (32-bit)
UUID:            2d953964-308f-4726-9a3b-21ee0af5a1b8
Config file:     /home/paul/VirtualBox VMs/XP-MediaServer/XP-MediaServer.vbox
Snapshot folder: /home/paul/VirtualBox VMs/XP-MediaServer/Snapshots
Log folder:      /home/paul/VirtualBox VMs/XP-MediaServer/Logs
Hardware UUID:   2d953964-308f-4726-9a3b-21ee0af5a1b8
Memory size:     2048MB
Page Fusion:     off
VRAM size:       64MB
CPU exec cap:    81%
HPET:            off
Chipset:         piix3
Firmware:        BIOS
Number of CPUs:  1
PAE:             off
Long Mode:       off
CPUID Portability Level: 0
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): HardDisk
Boot Device (2): Not Assigned
Boot Device (3): Not Assigned
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          on
Time offset:     0ms
RTC:             local time
Hardw. virt.ext: off
Nested Paging:   off
Large Pages:     on
VT-x VPID:       on
VT-x unr. exec.: on
Paravirt. Provider: Default
State:           running (since 2015-12-30T13:12:19.653000000)
Monitor count:   1
3D Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address: 
Teleporter Password: 
Tracing Enabled: off
Allow Tracing to Access VM: off
Tracing Configuration: 
Autostart Enabled: on
Autostart Delay: 0
Default Frontend: 
Storage Controller Name (0):            IDE
Storage Controller Type (0):            PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  2
Storage Controller Port Count (0):      2
Storage Controller Bootable (0):        on
IDE (0, 0): /data/virtualbox/XP-MediaServer.vdi (UUID: 4f95a78c-0962-443e-b748-5e60b0e79f0d)
IDE (1, 0): /opt/VirtualBox/VBoxGuestAdditions.iso (UUID: 2475c412-621f-48cf-a602-0f4630380643)
NIC 1:           MAC: 0800278D29E1, Attachment: Bridged Interface 'net0 - Ethernet', Cable connected: on, Trace: off (file: none), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 2:           disabled
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
Pointing Device: PS/2 Mouse
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
LPT 1:           disabled
LPT 2:           disabled
Audio:           enabled (Driver: SolAudio, Controller: AC97, Codec: STAC9700)
Clipboard Mode:  disabled
Drag and drop Mode: disabled
Session name:    GUI/Qt
VRDE:            enabled (Address 0.0.0.0, Ports 5859, MultiConn: off, ReuseSingleConn: off, Authentication type: null)
Video redirection: disabled
VRDE property: TCP/Ports  = "5859"
VRDE property: TCP/Address = <not set>
VRDE property: VideoChannel/Enabled = <not set>
VRDE property: VideoChannel/Quality = <not set>
VRDE property: VideoChannel/DownscaleProtection = <not set>
VRDE property: Client/DisableDisplay = <not set>
VRDE property: Client/DisableInput = <not set>
VRDE property: Client/DisableAudio = <not set>
VRDE property: Client/DisableUSB = <not set>
VRDE property: Client/DisableClipboard = <not set>
VRDE property: Client/DisableUpstreamAudio = <not set>
VRDE property: Client/DisableRDPDR = <not set>
VRDE property: H3DRedirect/Enabled = <not set>
VRDE property: Security/Method = <not set>
VRDE property: Security/ServerCertificate = <not set>
VRDE property: Security/ServerPrivateKey = <not set>
VRDE property: Security/CACertificate = <not set>
VRDE property: Audio/RateCorrectionMode = <not set>
VRDE property: Audio/LogPath = <not set>
USB:             enabled
EHCI:            enabled
XHCI:            disabled

USB Device Filters:

Index:            0
Active:           yes
Name:             TSSTcorp USB Mass Storage Device [0606]
VendorId:         13fd
ProductId:        2040
Revision:         0606
Manufacturer:     TSSTcorp
Product:          USB Mass Storage Device 
Remote:           0
Serial Number:    SATAHH00000000c66f4

Bandwidth groups:  <none>

Shared folders:  

Name: 'data', Host path: '/data' (machine mapping), writable

Video capturing:    not active
Capture screens:    0
Capture file:       /home/paul/VirtualBox VMs/XP-MediaServer/XP-MediaServer.webm
Capture dimensions: 1024x768
Capture rate:       512 kbps
Capture FPS:        25

Guest:

Configured memory balloon size:      0 MB
Thanks
Attachments
vbox_bootingXP.svg.txt
(121.47 KiB) Downloaded 33 times
Last edited by brainz on 29. Jan 2016, 03:54, edited 1 time in total.
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: Windows XP guest poor performance - clock_gettime

Post by michaln »

Not much to say with out VBox.log, other than the obvious fact that 89% CPU utilization implies anything but an idle VM.

Getting the time can be an expensive operation in the VM depending on exactly what it does. If it causes a VM exit then yes, it will take time. The only time source that has a chance of being cheap (but isn't always) is the TSC.
brainz
Posts: 6
Joined: 30. Dec 2015, 14:53

Re: Windows XP guest poor performance - clock_gettime

Post by brainz »

Hi Michaln,

Thanks for the reply, I have uploaded the VirtualBox log from a session booted into Safe Mode within the VM with nothing started. After leaving idle for a few minutes it was shutdown, throughout the whole time the 'VBoxHeadless' process on the Solaris host was taking 80% plus of CPU.
Attachments
VBox.log
(85.92 KiB) Downloaded 25 times
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: Windows XP guest poor performance - clock_gettime

Post by michaln »

XP + I/O APIC + AMD CPU = bad. Don't do it. Why did you enable the I/O APIC anyway?

There's also only so much you can expect from such a low performance CPU.
brainz
Posts: 6
Joined: 30. Dec 2015, 14:53

Re: Windows XP guest poor performance - clock_gettime

Post by brainz »

michaln wrote:XP + I/O APIC + AMD CPU = bad. Don't do it. Why did you enable the I/O APIC anyway?
Not a conscious choice, it looks like the selection of 64bit XP as the guest OS enabled this option as default, its not something I need but looks like I'm stuck with it now (OS won't boot with it off).

:(
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: Windows XP guest poor performance - clock_gettime

Post by michaln »

brainz wrote:Not a conscious choice, it looks like the selection of 64bit XP as the guest OS enabled this option as default,
Ah, that thing... I think that should be no longer the case (but was for a long time). Sadly 64-bit XP needs the I/O APIC while 32-bit XP suffers.
its not something I need but looks like I'm stuck with it now (OS won't boot with it off).
The famous Microsoft Plug & Play implementation. There are some guides around showing how to change the XP HAL after installation. I don't recall the details. You want the "ACPI PC" HAL, not the "ACPI Uniprocessor PC" (probably) HAL.
brainz
Posts: 6
Joined: 30. Dec 2015, 14:53

Re: Windows XP guest poor performance - clock_gettime

Post by brainz »

Problem solved!

Thanks michain it was the XP + I/O APIC + AMD CPU which was killing me!

Just rebuilt the VM, playing with Windows too long makes me feel dirty :o the VM is now idle at 2% of Solaris host CPU.
Post Reply