From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: add back pending timer irqs for kernel APIC timer Date: Mon, 13 Aug 2007 11:50:32 +0300 Message-ID: <46C01B58.8080402@qumranet.com> References: <10EA09EFD8728347A513008B6B0DA77A01E8DA94@pdsmsx411.ccr.corp.intel.com> <46BC9A7E.5040206@qumranet.com> <10EA09EFD8728347A513008B6B0DA77A01E8DACC@pdsmsx411.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel To: "Dong, Eddie" Return-path: In-Reply-To: <10EA09EFD8728347A513008B6B0DA77A01E8DACC-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Dong, Eddie wrote: > Avi Kivity wrote: > >> Dong, Eddie wrote: >> >>> Add back pending irqs for apic timer to get precise guest >>> APIC timer interrupt. >>> >>> >> Can you explain the problem and the solution in more detail? >> > > Today guest sleep 10 seconds only get about 5-6 seconds in host time. > A design philosiphy in various VMM is that guest wall clock should catch > up host wall clock. > > The reason (partly) is that A VM may be descheduled, while the host time > is still going. For periodic timer like APIC timer, guest expect to see > certain amount of interrupt that stands for the time passed (host time). > In previous > APIC timer virtualization policy, we inject an IRQ to APIC when a period > of host time is passed, but the guest may not take it if it is > descheduled. > In that way the previous irq in APIC will be overwritten by next > injection from fire of > host hrtimer. In that way guest get less amount of APIC timer IRQ. > > This patch keep track of the pending irqs and inject them back to guest > eventually > even the guest may be descheduled. This is also what we did in Xen. > BTW, This policy will also be applied to future kernel PIT, I just do it > step by step. > > I see. We have something like that in userspace (called the time-drift-fix, or tdf). Will look at the patch now. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/