qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: geleman@gmail.com, aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] fix race between timer firing vs. alarm_timer->pending = 0
Date: Sat, 27 Mar 2010 14:05:34 +0100	[thread overview]
Message-ID: <20100327130534.GN15194@volta.aurel32.net> (raw)
In-Reply-To: <1268994635-5788-1-git-send-email-pbonzini@redhat.com>

On Fri, Mar 19, 2010 at 11:30:35AM +0100, Paolo Bonzini wrote:
> The period for Win32 timers is very short and always the same
> independent of dynticks, so it's possible that the timer fires
> before qemu_run_all_timers has reset alarm_timer->pending to zero.
> Reset alarm_timer->pending before rearming.

Thanks, applied.

> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  qemu-timer.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/qemu-timer.c b/qemu-timer.c
> index 329d3a4..49eac86 100644
> --- a/qemu-timer.c
> +++ b/qemu-timer.c
> @@ -706,14 +706,14 @@ void configure_icount(const char *option)
>  
>  void qemu_run_all_timers(void)
>  {
> +    alarm_timer->pending = 0;
> +
>      /* rearm timer, if not periodic */
>      if (alarm_timer->expired) {
>          alarm_timer->expired = 0;
>          qemu_rearm_alarm_timer(alarm_timer);
>      }
>  
> -    alarm_timer->pending = 0;
> -
>      /* vm time timers */
>      if (vm_running) {
>          qemu_run_timers(vm_clock);
> -- 
> 1.6.6.1
> 
> 
> 
> 

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

      reply	other threads:[~2010-03-27 13:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-19  5:24 [Qemu-devel] [PATCH, RFC] qemu-timer: fix alarm_timer pending TeLeMan
2010-03-19  9:33 ` [Qemu-devel] " Paolo Bonzini
2010-03-19  9:47   ` TeLeMan
2010-03-19 10:30     ` [Qemu-devel] [PATCH] fix race between timer firing vs. alarm_timer->pending = 0 Paolo Bonzini
2010-03-27 13:05       ` Aurelien Jarno [this message]

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=20100327130534.GN15194@volta.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=aliguori@us.ibm.com \
    --cc=geleman@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).