Ticket #7796 (closed defect: fixed)

Opened 6 years ago

Last modified 2 days ago

Iffy serial port cause >95% CPU usage in a VM

Reported by: jimoe Owned by:
Priority: major Component: uart
Version: VirtualBox 3.2.12 Keywords:
Cc: Guest type: other
Host type: Linux

Description (last modified by frank) (diff)

opensuse v11.3

linux x86_64

USRobotics FAX/modem 5637

The serial port is enabled and set for COM1. The "Port Mode" is set to "Host Device" and the "Port/File Path" is USBACM0.

When the VM starts up, it complains that the COM port is "iffy" (paraphrase) and may not work. It does in fact work and quite well. However, the VM is spinning in a loop somewhere because the CPU usage for one core (of a quad processor) averages about 95%. Good thing it's a quad core CPU. The actual core in use switches around but at any one time a core is running close to maximum. The CPU usage within the VM guest itself is normal, less than 5%.

If I disable the serial port, the VM's CPU usage drops back to normal (5 - 10%).


VBox.log Download (42.7 KB) - added by jimoe 6 years ago.
Log file of the VM that uses lots of CPU time doing nothing

Change History

Changed 6 years ago by jimoe

Log file of the VM that uses lots of CPU time doing nothing

comment:1 Changed 6 years ago by jimoe

Oops. The "Port/File Path" is "/dev/ttyACM0". (Shouldn't have trusted my memory.)

comment:2 Changed 6 years ago by frank

Do you know if this is a regression, have you ever tried an older version of VBox with the same setup?

comment:3 Changed 6 years ago by jimoe

Do you know if this is a regression? ...

No, I do not know. I could find no other report that mentioned this particular problem.

It is a recent change of modems. Previously we were using an actual serial port connected to a modem with a serial cable. The serial ports are an add-on card. I got tired of having to recompile the port driver every time the kernel was updated; usually I had to hack to the code to adapt it to changes in the kernel. It's enough hassle rebuilding for VBox.

...have you ever tried an older version of VBox with the same setup?

I do not think it was a problem on 3.2.10. I cannot get to the computer that is running that VM at the moment. It will have to wait until this evening to test it.

comment:4 Changed 6 years ago by jimoe

I have verified that this is NOT a problem in v3.2.10.

comment:5 Changed 6 years ago by jimoe

The problem persists in v4.0-4.0.0_69151_openSUSE113-1.x86_64.

comment:6 Changed 5 years ago by manfred99

Same issue here: exactly the same modem, same problem. What jimoe not explicitely stressed: it is a USB modem which is provided to the guest as serial device.

I also tried another USB modem, 100% CPU, too. With a real serial modem (attached to the host serial port), things are fine. So there must be some issue with polling of these USB devices.

For me it is not a regression, 3.2.12 was bad, too. I did not try even older versions, though. Issue persisting in 4.0.6.

Is there a possibility to influence the polling rate? Modems aren't really high-speed devices, so less frequent polling would be fine, too.

comment:7 Changed 5 years ago by manfred99

OK, I re-read the post of jimoe from 2010-12-07, which tells that version 3.2.10 is OK.

I now installed 3.2.10 and indeed, ~1% CPU load when idle. So my installation goes from 1% to 100% CPU when upgrading from 3.2.10 to 3.2.12.

comment:8 Changed 5 years ago by frank

Ok, it is quite clear which code introduced that problem for you. Unfortunately this code was added to prevent hangs on other systems. We have to investigate how we can fix both problems.

comment:9 Changed 5 years ago by GregH

I have the same issue on a Linux host with both 4.0.4 and 4.0.10. This issue is related to #8724, I believe.

In my case, having serial in VirtualBox enabled, isn't itself an issue, it's which Host Device I use that changes things.

When using the internal RS-232 port, as ttyS0, CPU usage is normal. But, when I use an USB->RS-232 converter, as ttyUSB0, CPU usage on the host is 100% for one of my two cores.

Linux kernel / Guest OS Windows XP

comment:10 Changed 5 years ago by manfred99

Any news on this?

Version 4.1.2 is still bad, and the bug already is 9 months old! I'm constantly polluting the environment since months, as my CPU consumes additional ~40W this way...

comment:11 Changed 5 years ago by jimoe

I got tired of waiting for this to be fixed. Since I already had some old FAX modems, I purchased a CP Technologies USB-to-Serial Adapter which is natively supported in linux. And retired the USRobotics USB modem.

The system detected the adapter and created a /dev/ttyUSB0 device. I then set the VM to use that device for its COM1 connection and all is good again.

comment:12 Changed 3 years ago by manfredsch

Ping !?

I just tried Virtualbox 4.3, still the same issue: Everything works fine, but the COM-Port causes the VM to consume 100% CPU.

The report is 3 years old now, and Frank told in comment 8 that the cause is clear, 2 years ago ...

Could someone look at this issue again? Thanks!

comment:13 Changed 2 years ago by manfredsch

Still the same issue with Virtualbox 4.3.14 (with "USB: performance fixes"):

Constant 100% CPU when guest COM-Port is connected to the USB Modem (attached via linux usb-serial driver). This is with Linux 3.11.10 as host.

comment:14 Changed 2 years ago by frank

  • Description modified (diff)

A guest COM port has nothing to do with the USB emulation.

comment:15 Changed 2 months ago by aeichner

  • Status changed from new to closed
  • Resolution set to obsolete

Please reopen if still relevant with a recent VirtualBox release.

comment:16 Changed 2 months ago by manfredsch

  • Status changed from closed to reopened
  • Resolution obsolete deleted

Still the very same issue, CPU is constantly at 100%

I'm at the moment on Linux 3.12.62 as host, using VirtualBox 5.0.26

comment:17 Changed 2 months ago by aeichner

This will hopefully be fixed for good in the next maintenance release, please try a test build from here.

comment:18 Changed 2 months ago by GregH2

To support manfredsch, I can confirm this is still a bug on VB 5.0.14 on kernel 4.4.13. I'll test the next maintenance release.

comment:19 Changed 6 weeks ago by frank

  • Status changed from reopened to closed
  • Resolution set to fixed

Fix is part of VBox 5.1.6.

comment:20 Changed 2 days ago by manfredsch

OK, I installed 5.0.28 now (I'm on opensuse 13.1 still), and things are fixed, indeed.

I have about 10% CPU usage now, so ~5-7 percent points CPU overhead due to the modem.

Thanks a lot!

comment:21 Changed 2 days ago by frank

Thanks for the feedback!

Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use