From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Habkost Subject: Re: 2.6.27.5 guest boot failure using in-kernel PIT Date: Fri, 21 Nov 2008 15:06:42 -0200 Message-ID: <20081121170642.GH30825@blackpad> References: <20081120142253.GA30825@blackpad> <20081120220517.GB30825@blackpad> <49266950.40200@web.de> <20081121131741.GC30825@blackpad> <4926D68C.8050401@web.de> <20081121163922.GG30825@blackpad> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Jan Kiszka Return-path: Received: from mx2.redhat.com ([66.187.237.31]:36315 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756210AbYKURHN (ORCPT ); Fri, 21 Nov 2008 12:07:13 -0500 Content-Disposition: inline In-Reply-To: <20081121163922.GG30825@blackpad> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Nov 21, 2008 at 02:39:22PM -0200, Eduardo Habkost wrote: > On Fri, Nov 21, 2008 at 04:41:00PM +0100, Jan Kiszka wrote: > > Eduardo Habkost wrote: > > > I am seeing the problem here > > > when using the in-kernel PIT, but (surprisingly) my setup works when > > > using -no-kvm-pit. > > > > Weird, makes no sense to me as well ATM. > > The qemu PIT seems to calculate the timeout for its timer as a function > of the time where the PIT timer was set up (count_load_time) and the > last timer set up (next_transition_time), without looking at the current > time. After missing some ticks and getting the timer triggered late, > it will set up a lot of "trigger on the past" timers before the guest > finished the mdelay() loop. > > The in-kernel PIT seems to try to do the same thing (it just calls > hrtimer_add_expires_ns() on the timer), but maybe the behaviour of the > kernel timers is different of the qemu timers when a timer is set up > to be triggered on the past. On my host-HZ=250 guest-HZ=1000 setup, > it was incrementing pit_timer.pending only once every 4 milliseconds. That's the case. From a probe on __pit_timer_fn.return: 19344471136382 timer_fn returning. timer expires now at: 19343448496177 19344475128359 timer_fn returning. timer expires now at: 19343449496025 19344479128694 timer_fn returning. timer expires now at: 19343450495873 19344483129394 timer_fn returning. timer expires now at: 19343451495721 The number at the beginning of the lines is ktime_get(). The timer expiration time is on the past, but the kernel keeps triggering the timer once every 4 ms. -- Eduardo