From owner-freebsd-xen@FreeBSD.ORG Mon Nov 22 10:30:35 2010 Return-Path: Delivered-To: freebsd-xen@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 277761065670 for ; Mon, 22 Nov 2010 10:30:35 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from xps.daemonology.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with SMTP id 3CAD91574E1 for ; Mon, 22 Nov 2010 10:30:30 +0000 (UTC) Received: (qmail 71639 invoked from network); 22 Nov 2010 10:30:29 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 22 Nov 2010 10:30:29 -0000 Message-ID: <4CEA4645.2000502@freebsd.org> Date: Mon, 22 Nov 2010 02:30:29 -0800 From: Colin Percival User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.11) Gecko/20100803 Thunderbird/3.0.6 MIME-Version: 1.0 To: "freebsd-xen@freebsd.org" References: <4CE68CD7.10804@freebsd.org> <1290191413.1758.16.camel@localhost> <4CE77AE7.3010106@freebsd.org> In-Reply-To: <4CE77AE7.3010106@freebsd.org> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: system stalls when wallclock/TOD nudged X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Nov 2010 10:30:35 -0000 Hi all, On 11/19/10 23:38, Colin Percival wrote: > It seems that this bug is related somehow to the idle thread sleeping -- when > I comment out the call to idle_block from cpu_idle_hlt in i386/machdep.c the > stalling goes away. Ok, it turns out that the problem was a bit more complicated than this. There were two bugs, actually: First, Xen's timecounter was being rounded from ns precision to 1/HZ precision for no apparent reason; and second, the periodic clock interrupt isn't being delivered. I've fixed the first of these, and that is enough to prevent the stalling; I need to learn more about Xen interrupts, event channels, etc. to track down why we're not getting a clock interrupt. (The timer set by set_timer_op before we call SCHEDOP_block is waking us up -- but the missing clock interrupt means that we aren't preempting userland code, which is a rather Bad Thing.) -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid