From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brad Campbell Subject: Re: high load with win7 & usb tablet Date: Tue, 14 Sep 2010 16:46:01 +0800 Message-ID: <4C8F3649.7020905@fnarfbargle.com> References: <4C80E839.50604@msgid.tls.msk.ru> <4C8A2254.7090505@redhat.com> <4C8A282A.5010506@msgid.tls.msk.ru> <4C8A29A6.60108@redhat.com> <4C8A44E6.2060008@msgid.tls.msk.ru> <4C8A4736.8030704@redhat.com> <4C8A48D9.2070404@msgid.tls.msk.ru> <4C8A56B8.4020607@redhat.com> <4C8F31A8.9050007@fnarfbargle.com> <4C8F335B.3030607@msgid.tls.msk.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , KVM list To: Michael Tokarev Return-path: Received: from fnarfbargle.com ([93.93.128.63]:36429 "EHLO fnarfbargle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752315Ab0INIqJ (ORCPT ); Tue, 14 Sep 2010 04:46:09 -0400 In-Reply-To: <4C8F335B.3030607@msgid.tls.msk.ru> Sender: kvm-owner@vger.kernel.org List-ID: 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?