From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [patch 4/8] KVM: x86: replace hrtimer based timer emulation Date: Wed, 8 Jul 2009 13:24:04 -0300 Message-ID: <20090708162404.GA6803@amt.cnet> References: <20090706015511.923596553@localhost.localdomain> <20090706015812.786509491@localhost.localdomain> <4A54A202.9080602@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:44167 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752803AbZGHQYY (ORCPT ); Wed, 8 Jul 2009 12:24:24 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n68GON9G027978 for ; Wed, 8 Jul 2009 12:24:23 -0400 Content-Disposition: inline In-Reply-To: <4A54A202.9080602@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Jul 08, 2009 at 04:41:22PM +0300, Avi Kivity wrote: > On 07/06/2009 04:55 AM, Marcelo Tosatti wrote: >> Replace hrtimer based timer emulation with host timebase (ktime_t) >> comparisons on guest entry. >> >> This avoids host load when guests are scheduled out, removes a >> spinlock acquision on entry (i8254.c's inject_lock), and makes future >> improvements easier. >> > > I wonder if we're really winning with this. Guests should be > scheduled-out-but-not-halted rarely, and in all other cases we need to > keep the timer. A timer comparison on each guest entry might be > expensive (maybe not so much with tsc based timers). Any activity outside of guest mode that takes more than the period of the timer (think 1000Hz) causes unnecessary host load. Booting a RHEL5 UP without VNC or serial output on an idle host: timer_int_normal=95416 timer_interrupt_accumulated=873 (and it continues to increase in that rate, roughly 1%). Now factor in multiple guests, loaded host, and you'll probably see more than that.