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: Mon, 05 Apr 2010 11:22:32 +0300 Message-ID: <4BB99DC8.6030106@redhat.com> References: <4B87A6BF.3090301@redhat.com> <201004041525.18211.paul@codesourcery.com> <4BB8C51A.6070908@redhat.com> <201004042253.18066.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]:29983 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751150Ab0DEIXH (ORCPT ); Mon, 5 Apr 2010 04:23:07 -0400 In-Reply-To: <201004042253.18066.paul@codesourcery.com> Sender: kvm-owner@vger.kernel.org List-ID: On 04/05/2010 12:53 AM, Paul Brook wrote: > >> 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. > That was 125 interrupts/sec x 10 fds ('poll' here was the per-file callback in the kernel, not the select call). With your numbers, it's more like 10k polls/sec which can be eliminated. > 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. > I was estimating from the strace parsed output, the real number is 7. So the kernel calls 7k callbacks/sec only to return with a timeout. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.