On 14/09/10 16:33, Michael Tokarev wrote:
14.09.2010 12:26, Brad Campbell wrote:
[]
Just a data point. An idle XP guest for me without -usb sees the host
running at about 8,000 context switches a second. With the guest using
-usb -usbdevice tablet, the host runs at between 15,000 - 18,000 context
switches a second.
Yes, I observed the same as well.
The descriptors show the device is requesting a polling frequency of
100Hz (0x0A ms), but don't forget QEMU emulating a controller with a
1000hz microframe rate at worst.
Yes, that's 10ms, which is way too frequent IMHO. WinXP performs
polling at 130Hz, win7 can do higher.
There would probably be a lower load if the controller emulated was OHCI
rather than UHCI just on a reduction of required work by the Guest.
What's the diff. between the two?
UHCI uses a less intelligent controller that pushes a bit more of the load onto the host CPU. OHCI
uses silicon that has a few more smarts and therefore requires less work on the part of the host. In
a QEMU context I'd hazard a guess that OHCI would require less switches into the guest, but more
host code.
I tried to fire up Virtualbox to see what it reports for its controllers, and how it goes with host
load, but it refused to load with the kvm kernel module in and I have a guest I can't shut down
right now.
If you were prepared to tolerate a bit less responsiveness, you could
always tweak the endpoint descriptor to turn the polling frequency down.
0x0a, /* u8 ep_bInterval; (255ms -- usb 2.0 spec) */
I'm unclear as to where that comment came from. The usb 2.0 spec says a
LOW_SPEED device can request between 10->255 ms polling intervals. If
the device is reporting as a HIGH_SPEED device, then all bets are off.
I already found this place, and already questioned where that
comment come from (no one answered).
But the thing is that changing this value to, say, 0xff (255ms)
does not actually change the load level for me -- not for linux
guest not for w7 guest. The descriptor is indeed changes, lsusb
correctly reports bInterval=255, but exactly nothing changes.
I can confirm this also. Should have tested before posting. Sorry.
How about running Powertop in the linux guest to get a handle on what it's doing?
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html