From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NyhaO-0002t1-NP for qemu-devel@nongnu.org; Mon, 05 Apr 2010 04:23:08 -0400 Received: from [140.186.70.92] (port=48082 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NyhaN-0002st-75 for qemu-devel@nongnu.org; Mon, 05 Apr 2010 04:23:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NyhaL-0007aO-Ob for qemu-devel@nongnu.org; Mon, 05 Apr 2010 04:23:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24351) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NyhaL-0007Zz-GG for qemu-devel@nongnu.org; Mon, 05 Apr 2010 04:23:05 -0400 Message-ID: <4BB99DC8.6030106@redhat.com> Date: Mon, 05 Apr 2010 11:22:32 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] High CPU use of -usbdevice tablet (was Re: KVM usability) References: <4B87A6BF.3090301@redhat.com> <201004041525.18211.paul@codesourcery.com> <4BB8C51A.6070908@redhat.com> <201004042253.18066.paul@codesourcery.com> In-Reply-To: <201004042253.18066.paul@codesourcery.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: Chris Webb , qemu-devel@nongnu.org, kvm@vger.kernel.org, =?UTF-8?B?SmVybmVqIFNpbW9uxI1pxI0=?= 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.