From: Keir Fraser Subject: Re: [PATCH] x86 hvm: fix missing ticks issue in c/s 20218 Date: Fri, 25 Sep 2009 08:58:23 +0100 Message-ID: References: <7kzl8jprl5.fsf@pingu.sky.yk.fujitsu.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <7kzl8jprl5.fsf@pingu.sky.yk.fujitsu.co.jp> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Kouya Shimura , "xen-devel@lists.xensource.com" Cc: Christoph Egger List-Id: xen-devel@lists.xenproject.org This patch is very dubious. It appears to break pt_process_missed_ticks() logic for timer modes 0 and 1. When a VCPU gets rescheduled it will have missed ticks folded into ->scheduled and ->pending_intr_nr fields, but since you stomp on the logic for tracking pending_intr_nr, most of those missed ticks will never get delivered. I think the fix is to move the line 'pt->scheduled += pt->period' out of pt_intr_post() and back into pt_timer_fn(). This is because you have otherwise broken the invariant that pt->scheduled always gets incremented along with pt->pending_intr_nr. All the rest of your 'fixes' are I think merely working around that fundamental brokeness. Please try moving that one line and see if the bug goes away. -- Keir On 25/09/2009 05:37, "Kouya Shimura" wrote: > Although c/s 20229 fixes missing ticks issue in c/s 20218, > it's not enough. > > - set a timer to the next period more straightforwardly. > - fix an unexpected behavior of both timer_mode=2 and timer_mode=3. > extra interrupts might be delivered to a guest. > > Signed-off-by: Kouya Shimura >