From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WC7vh-000698-6d for qemu-devel@nongnu.org; Sat, 08 Feb 2014 08:26:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WC7vY-00014z-PB for qemu-devel@nongnu.org; Sat, 08 Feb 2014 08:26:45 -0500 Received: from mail-ee0-x234.google.com ([2a00:1450:4013:c00::234]:41617) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WC7vY-00014v-Ij for qemu-devel@nongnu.org; Sat, 08 Feb 2014 08:26:36 -0500 Received: by mail-ee0-f52.google.com with SMTP id e53so2028186eek.39 for ; Sat, 08 Feb 2014 05:26:35 -0800 (PST) Sender: Paolo Bonzini Message-ID: <52F63084.2040406@redhat.com> Date: Sat, 08 Feb 2014 14:26:28 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <482BBC19-D3C5-4ED3-97E7-60A4046905DF@alex.org.uk> In-Reply-To: <482BBC19-D3C5-4ED3-97E7-60A4046905DF@alex.org.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] timer issue on 1.7.0 and later List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh , Rob Herring Cc: Peter Maydell , qemu-devel@nongnu.org Il 08/02/2014 12:48, Alex Bligh ha scritto: > Rob, > > On 7 Feb 2014, at 18:15, Rob Herring wrote: > >> I've bisected a problem with system emulation and SMP kernels using >> per cpu timers to this commit. I can reproduce this problem on ARM >> emulation with both ARM generic timers (only in 1.7.0) and ARM MPCore >> timers. Using a single broadcast timer in the guest kernel works fine. >> My host is ubuntu 13.10. > > I don't know the ARM emulation well, but from the description this looks > like a problem where timers are firing too often. The timer changes have > tended to uncover bugs elsewhere in the QEMU, for instance setting timer > expiry times to something very near zero. So far (touch wood) the timer > changes themselves have been relatively clean. > > What I'd suggest you do is run qemu within gdb, and when you have > seen the sluggish behaviour, set a breakpoint in timerlist_run_timers > just before the line saying cb(opaque). If I'm right your breakpoint > should immediately hit. Step in to the callback and note which it is. > It should always (or nearly always) be the same timer (note the process > of debugging will cause other timers to expire). Alex, could you add a trace event to timerlist_run_timers and mod_timer? For timerlist_run_timer it should include the timer (ts), the callback and the opaque value. This would make it simpler to find if this is the cause, and to debug it without introducing as much perturbation. Paolo > You then want to find where that timer is set and see if the expiry > value looks silly. Normally the issue is that timer_mod takes an > argument (i) which is absolute time, not an interval, and (ii) is > measured in nanoseconds unless the timer's scale has been > set otherwise (quite often I've seen it read the current time > in nanoseconds then add an offset in milliseconds). > > If you find which timer it is but can't work out why it's doing it, > I can take another look.