All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] Re: [PATCH] fix halt emulation with icount and CONFIG_IOTHREAD
Date: Tue, 15 Feb 2011 18:04:46 -0200	[thread overview]
Message-ID: <20110215200446.GA15802@amt.cnet> (raw)
In-Reply-To: <4D5ACCED.1080906@siemens.com>

On Tue, Feb 15, 2011 at 07:58:53PM +0100, Jan Kiszka wrote:
> On 2011-02-15 18:54, Marcelo Tosatti wrote:
> > 
> > Note: to be applied to uq/master.
> > 
> > In icount mode, halt emulation should take into account the nearest event when sleeping.
> > 
> > Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
> > Reported-and-tested-by: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
> > 
> > diff --git a/cpus.c b/cpus.c
> > index 468544c..21c3eba 100644
> > --- a/cpus.c
> > +++ b/cpus.c
> > @@ -770,7 +770,7 @@ static void qemu_tcg_wait_io_event(void)
> >      CPUState *env;
> >  
> >      while (all_cpu_threads_idle()) {
> > -        qemu_cond_timedwait(tcg_halt_cond, &qemu_global_mutex, 1000);
> > +        qemu_cond_timedwait(tcg_halt_cond, &qemu_global_mutex, qemu_calculate_timeout());
> 
> checkpatch.pl would complain here.
> 
> More important: Paolo was proposing patches to eliminate all those fishy
> cond_wait timeouts. That's probably the better way to go. The timeouts
> only paper over missing signaling.
>
> >      }
> >  
> >      qemu_mutex_unlock(&qemu_global_mutex);
> > diff --git a/vl.c b/vl.c
> > index b436952..8ba7e9d 100644
> > --- a/vl.c
> > +++ b/vl.c
> > @@ -1335,7 +1335,7 @@ void main_loop_wait(int nonblocking)
> >      if (nonblocking)
> >          timeout = 0;
> >      else {
> > -        timeout = qemu_calculate_timeout();
> > +        timeout = 1000;
> >          qemu_bh_update_timeout(&timeout);
> >      }
> >  
> 
> Isn't this path also relevant for !IOTHREAD? What's the impact of this
> change for that configuration?

Timeout changes from 5s to 1s.

  reply	other threads:[~2011-02-15 20:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 17:54 [Qemu-devel] [PATCH] fix halt emulation with icount and CONFIG_IOTHREAD Marcelo Tosatti
2011-02-15 18:58 ` [Qemu-devel] " Jan Kiszka
2011-02-15 20:04   ` Marcelo Tosatti [this message]
2011-02-15 20:33     ` Jan Kiszka
2011-02-15 20:55       ` Marcelo Tosatti
2011-02-15 20:56         ` [Qemu-devel] [PATCH] fix halt emulation with icount and CONFIG_IOTHREAD (v2) Marcelo Tosatti
2011-02-16  8:27           ` [Qemu-devel] " Jan Kiszka
2011-02-16  9:32           ` Paolo Bonzini
2011-02-16  9:46             ` Jan Kiszka
2011-02-16  9:57               ` Paolo Bonzini
2011-02-16 10:04                 ` Jan Kiszka
2011-02-16 10:27                   ` Paolo Bonzini
2011-02-16 10:34                     ` Jan Kiszka
2011-02-16 11:05                       ` Paolo Bonzini
2011-02-17  3:15             ` Marcelo Tosatti
2011-02-17  8:27               ` Paolo Bonzini
2011-02-18 17:13                 ` Paolo Bonzini
2011-02-17  8:29               ` Jan Kiszka

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=20110215200446.GA15802@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=jan.kiszka@siemens.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.