Page 1 of 1

High CPU with idle Ubuntu 10.04 guest after a certain period

Posted: 28. Apr 2011, 04:55
by tonyd
Hi,

I know we've all seen the topics on 100% CPU on idle Linux guests, mostly due to the result of a Linux kernel timer frequency set higher than 100Hz or due to a multi-core glitch that seems to remedy itself when a "dummy" guest is also running. I don't think this falls into either of those cases.

Basically, I'm running the latest VBox 4.0.6 (this also happens on older versions too) on Windows 7 64-bit Ultimate. I also have the USB extensions installed and enabled on the guest. When starting a Linux guest (Ubuntu 10.04 64-bit in this case which I've verified has a timer frequency of 100Hz) everything runs fine. Then after a seemingly random time that could be hours or days later, my CPU spikes to 100% "of a core". In other words, if I have a dual-core, the total CPU usages is ~50%, and now that I have a quad-core, it's at ~25%. This CPU hogging remains indefinitely until I shut down the VM and wait for the VBoxSVC.exe process to end.

I believed I've narrowed this down to some sort of USB issue. Using Process Explorer, I was able to see that it is indeed a thread in VBoxSVC.exe that is hogging the CPU. (If it matters, I'm running in headless mode.) Here is the complete stack trace for the offending thread:

ntoskrnl.exe!memset+0x64a
ntoskrnl.exe!KeWaitForMultipleObjects+0xd52
ntoskrnl.exe!KeWaitForSingleObject+0x19f
ntoskrnl.exe!PoStartNextPowerIrp+0xba4
ntoskrnl.exe!PoStartNextPowerIrp+0x1821
ntoskrnl.exe!PoStartNextPowerIrp+0x1a97
VBoxDDU.dll!USBLibHasPendingDeviceChanges+0x1f3
VBoxDDU.dll!USBLibHasPendingDeviceChanges+0x550
VBoxDDU.dll!USBLibHasPendingDeviceChanges+0x9b2
VBoxDDU.dll!USBLibHasPendingDeviceChanges+0xb73
VBoxDDU.dll!USBLibGetDevices+0xd3

VBoxSVC.exe+0x24242f
VBoxSVC.exe+0x2201fb
VBoxSVC.exe+0x22182c
VBoxRT.dll!RTThreadFromNative+0x54f
VBoxRT.dll!RTSymlinkRead+0x2da
MSVCR80.dll!endthreadex+0x47
MSVCR80.dll!endthreadex+0x104
kernel32.dll!BaseThreadInitThunk+0xd
ntdll.dll!RtlUserThreadStart+0x21

I have no idea how much that helps, as I don't have the debug symbols available, but hopefully a VirtualBox developer can match the offsets in VBoxSVC to the correct function calls. The USB calls lead me to believe this may be USB related.

I am now going to try to disable USB on that VM and see if it happens again. If I can go at least three days without this happening, then I'm pretty confident that there is a USB bug/issue of some sort. I have never assigned this VM any USB devices, so there shouldn't be an issue there.

Hopefully I'm not the only one seeing this, and others have simply mistaken this for the other possible ways VBox results in CPU hogging. Process Explorer is a great help in cases like this.

Any help/suggestion are appreciated. I will report back on what happens if I disable USB on the VM.

Re: High CPU with idle Ubuntu 10.04 guest after a certain pe

Posted: 9. Feb 2015, 04:50
by BrianLakstins
Similar situation almost 4 years later...

Just tried disabling all USB integration with my 2 ubuntu guests.

Re: High CPU with idle Ubuntu 10.04 guest after a certain pe

Posted: 9. Feb 2015, 06:56
by BrianLakstins
Did not fix the problem. Vboxsvc.exe still consumes one full core of CPU after VMs are running for an hour or so.

Re: High CPU with idle Ubuntu 10.04 guest after a certain pe

Posted: 13. Feb 2015, 19:12
by BrianLakstins
I think that this error shows up just prior to VBoxSVC.exe consuming 100% of one cpu.

USBPROXY usbLibDevStrDrEntryGet: DeviceIoControl 1 fail winEr (23)

It shows up in VBoxSVC.log.

None of the configure virtual machines have the USB controller enabled.

Anyone know of a way I can just disable all USBPROXY functionality in VirtualBox?

Configuration:
Windows 7 Ultimate
VirtualBox 4.3.18 r96516

Virtual machines are Ubuntu 14.04 LTS.

Re: High CPU with idle Ubuntu 10.04 guest after a certain pe

Posted: 13. Feb 2015, 19:38
by mpack
Why did you latch onto this topic as explaining your high CPU problem?

Re: High CPU with idle Ubuntu 10.04 guest after a certain pe

Posted: 13. Feb 2015, 20:48
by tonyd
For the record, I continued to have this problem well into the 4.2.x timeframe.

Around that time I resorted to adding a daily scheduled job in Windows. Since I am using the VBoxVmService to manage powering up and suspending my VMs, the scheduled job simply:
1) stops the service (which results in suspending the VMs)
2) doing a ping with a count of 240 (or whatever arbitrary time works for you to ensure the vbox process has disappeared)
3) restart the service

This has done the trick for me, but it's a sad work-around. I actually should disable the job to confirm I'm still hitting this problem with the recent 4.3.x builds, but if there was never a targeted fix for it, I have my doubts it has gone away.

Re: High CPU with idle Ubuntu 10.04 guest after a certain pe

Posted: 20. Feb 2015, 15:44
by BrianLakstins
mpack wrote:Why did you latch onto this topic as explaining your high CPU problem?
Because of the USB error that I get right before the high CPU usage kicks in.

USBPROXY usbLibDevStrDrEntryGet: DeviceIoControl 1 fail winEr (23)

It seems to me that it is very similar to the functioning causing the error in the original post that hangs:

VBoxDDU.dll!USBLibGetDevices+0xd3