From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NyXl0-0001mb-Co for qemu-devel@nongnu.org; Sun, 04 Apr 2010 17:53:26 -0400 Received: from [140.186.70.92] (port=58218 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NyXky-0001mB-SN for qemu-devel@nongnu.org; Sun, 04 Apr 2010 17:53:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NyXkw-0006P5-SP for qemu-devel@nongnu.org; Sun, 04 Apr 2010 17:53:24 -0400 Received: from mx20.gnu.org ([199.232.41.8]:64852) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NyXkw-0006Oy-Ni for qemu-devel@nongnu.org; Sun, 04 Apr 2010 17:53:22 -0400 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NyXkv-00019d-V2 for qemu-devel@nongnu.org; Sun, 04 Apr 2010 17:53:22 -0400 From: Paul Brook Subject: Re: [Qemu-devel] High CPU use of -usbdevice tablet (was Re: KVM usability) Date: Sun, 4 Apr 2010 22:53:17 +0100 References: <4B87A6BF.3090301@redhat.com> <201004041525.18211.paul@codesourcery.com> <4BB8C51A.6070908@redhat.com> In-Reply-To: <4BB8C51A.6070908@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201004042253.18066.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Chris Webb , Jernej@gnu.org, Avi Kivity , kvm@vger.kernel.org, =?utf-8?q?Simon=C4=8Di=C4=8D?= > > 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. This actually confirms my hypothesis. After fixing the UHCI bug the guest is completely idle, but the host still needs to wake up at 1ms intervals to do UHCI emulation. I can believe that the most visible part of this is the select() syscall. > Surprising as there are ~10 descriptors being > polled, so ~1200 polls per second. Maybe epoll will help here. I'm not sure where you get 1200 from. select will be called once per host wakeup. i.e. if the USB controller is enabled then 1k times per second due to the frame tick. Are you sure there are actually 10 descriptors being polled? Remember that the nfds argument is the value of the largest fd in the set (+1), not the number of descriptors in the set. Paul