From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IMqTN-0006x4-Jq for qemu-devel@nongnu.org; Sun, 19 Aug 2007 15:30:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IMqTL-0006v2-Ot for qemu-devel@nongnu.org; Sun, 19 Aug 2007 15:30:05 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IMqTL-0006uq-Ko for qemu-devel@nongnu.org; Sun, 19 Aug 2007 15:30:03 -0400 Received: from il.qumranet.com ([82.166.9.18]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IMqTL-0006lz-63 for qemu-devel@nongnu.org; Sun, 19 Aug 2007 15:30:03 -0400 Message-ID: <46C89A38.60509@qumranet.com> Date: Sun, 19 Aug 2007 22:30:00 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [kvm-devel] [Qemu-devel] Re: [PATCH 0/4] Rework alarm timer infrastrucure - take2 References: <20070817231149.544849769@gmail.com> <20070819131042.GA22798@mail.shareable.org> <46C84A16.7040305@qumranet.com> <200708191457.21237.paul@codesourcery.com> <20070819171545.GB16928@mail.shareable.org> In-Reply-To: <20070819171545.GB16928@mail.shareable.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jamie Lokier Cc: kvm-devel@lists.sourceforge.net, Paul Brook , qemu-devel@nongnu.org Jamie Lokier wrote: > Paul Brook wrote: > >>> Yes, good thinking, but this should only be done if it actually impacts >>> something. Reducing overhead from 0.1% to 0.05% is not worthwhile if it >>> introduces extra complexity. >>> >> If the overhead is that small, why are we touching this code in the first >> place? >> > > Insightful. > > A benchmark result was posted which is rather interesting: > > >> [mkent@localhost ~]$ time ./hackbench 50 >> x86_64 host : real 0m10.845s >> x86_64 host, bound to 1 cpu : real 0m21.884s >> i386 guest+unix clock : real 0m49.206s >> i386 guest+hpet clock : real 0m48.292s >> i386 guest+dynticks clock : real 0m28.835s >> >> Results are repeatable and verfied with a stopwatch because I didn't >> believe them at first :) >> > > I am surprised if 1000 redundant SIGALRMs per second is really causing > 70% overhead in normal qemu execution, except on a rather old or slow > machine where signal delivery is very slow. > No, something else is happening here. On kvm, a signal is maybe 10us, to the SIGALRMs represent 1% of overhead. Respectable, but not more. I suspect that the increased accuracy causes something to behave better (or just differently). This won't be representative. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.