From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [Qemu-devel] High CPU use of -usbdevice tablet (was Re: KVM usability) Date: Sun, 04 Apr 2010 19:58:02 +0300 Message-ID: <4BB8C51A.6070908@redhat.com> References: <4B87A6BF.3090301@redhat.com> <4B938F9D.7010207@redhat.com> <20100404123116.GA19866@arachsys.com> <201004041525.18211.paul@codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, Chris Webb , kvm@vger.kernel.org, =?UTF-8?B?SmVybmVqIFNpbW9uxI1pxI0=?= To: Paul Brook Return-path: Received: from mx1.redhat.com ([209.132.183.28]:29783 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750721Ab0DDQ6i (ORCPT ); Sun, 4 Apr 2010 12:58:38 -0400 In-Reply-To: <201004041525.18211.paul@codesourcery.com> Sender: kvm-owner@vger.kernel.org List-ID: On 04/04/2010 05:25 PM, Paul Brook wrote: >>> Looks like the tablet is set to 100 Hz polling rate. We may be able >>> to get away with 30 Hz or even less (ep_bInterval, in ms, in >>> hw/usb-wacom.c). >>> >> Changing the USB tablet polling interval from 10ms to 100ms in both >> hw/usb-wacom.c and hw/usb-hid.c made no difference except the an increase >> in bInterval shown in lsusb -v in the guest and the hint of jerky mouse >> movement I expected from setting this value so high. A similar change to >> the polling interval for the keyboard and mouse also made no difference to >> their performance impact. >> > The USB HID devices implement the SET_IDLE command, so the polling interval > will have no real effect on performance. > On a Linux guest (F12), I see 125 USB interrupts per second with no mouse movement, so something is broken (on the guest or host). > My guess is that the overhead you're seeing is entirely from the USB host > adapter having to wake up and check the transport descriptor lists. This will > only result in the guest being woken if a device actually responds (as > mentioned above it should not). > A quick profile on the host side doesn't show this. Instead, I see a lot of select() overhead. Surprising as there are ~10 descriptors being polled, so ~1200 polls per second. Maybe epoll will help here. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.