qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Alex Bligh <alex@alex.org.uk>, Rob Herring <robherring2@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] timer issue on 1.7.0 and later
Date: Sat, 08 Feb 2014 14:26:28 +0100	[thread overview]
Message-ID: <52F63084.2040406@redhat.com> (raw)
In-Reply-To: <482BBC19-D3C5-4ED3-97E7-60A4046905DF@alex.org.uk>

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.

  reply	other threads:[~2014-02-08 13:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07 18:15 [Qemu-devel] timer issue on 1.7.0 and later Rob Herring
2014-02-08 11:48 ` Alex Bligh
2014-02-08 13:26   ` Paolo Bonzini [this message]
2014-02-08 15:20     ` Alex Bligh
2014-02-10 17:15       ` Rob Herring
2014-02-10 18:54         ` Alex Bligh
2014-02-13 15:36         ` Peter Maydell
2014-02-13 16:09           ` Alex Bligh
2014-02-13 16:20             ` Peter Maydell
2014-02-13 16:31               ` Alex Bligh
2014-02-13 17:04                 ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52F63084.2040406@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex@alex.org.uk \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=robherring2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).