All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Anders <mail@flac.kalibalik.dk>
Cc: kvm-devel@lists.sourceforge.net, Avi Kivity <avi@qumranet.com>
Subject: Re: [patch 2/2] QEMU: decrease console "refresh rate" with -nographic
Date: Mon, 14 Apr 2008 12:02:55 -0300	[thread overview]
Message-ID: <20080414150255.GA11640@dmt> (raw)
In-Reply-To: <4802352A.4010105@flac.kalibalik.dk>

On Sun, Apr 13, 2008 at 06:30:34PM +0200, Anders wrote:
> Marcelo Tosatti wrote:
> 
> >With SIGIO enabled on stdio, there's no need to wakeup the thread
> >performing IO every 30ms.
> >
> >Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
> >
> >Index: kvm-userspace.io/qemu/vl.c
> >===================================================================
> >--- kvm-userspace.io.orig/qemu/vl.c
> >+++ kvm-userspace.io/qemu/vl.c
> >@@ -5640,6 +5640,7 @@ static void dumb_display_init(DisplaySta
> >     ds->dpy_update = dumb_update;
> >     ds->dpy_resize = dumb_resize;
> >     ds->dpy_refresh = dumb_refresh;
> >+    ds->gui_timer_interval = 1000;
> > }
> > 
> > /***********************************************************/
> >
> 
> Why even the 1000ms timer? I was proposing to just set ds->dpy_refresh 
> to NULL for the dumb_display, but hit the qemu-devel dead-end.
> 
> http://lists.gnu.org/archive/html/qemu-devel/2008-01/msg00374.html
> 
> Do you see a problem with that approach? 

Issue is that the dumb console timer "wakes up" the vcpu to do IO
processing in main_loop_wait().

So while you're right that vga_hw_update() is a no-op for the -nographic
case, the indirect effect of the timer triggering main_loop_wait() is
needed for reading input from stdio in a way that feels interactive for
the user.

Which is of course not what the code appears to achieve. Apparently it
works by luck :)

I believe that qemu also wants a separate io thread doing select() with a
timeout rather than relying on signals.

> If yes, then that problem is 
> probably currently present in the unconnected VNC case, as that one now 
> disables the periodic timer completely.

Note that setting gui_timer_interval to 0 does not disable the timer:

/* in ms */
#define GUI_REFRESH_INTERVAL 30

static void gui_update(void *opaque)
{
    DisplayState *ds = opaque;
    ds->dpy_refresh(ds);
    qemu_mod_timer(ds->gui_timer,
        (ds->gui_timer_interval ?
            ds->gui_timer_interval :
            GUI_REFRESH_INTERVAL)
        + qemu_get_clock(rt_clock));
}


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

  reply	other threads:[~2008-04-14 15:02 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-11 18:38 [patch 0/2] SIGIO handling changes Marcelo Tosatti
2008-04-11 18:38 ` [patch 1/2] QEMU: use SIGARLM for alarm timers, enable SIGIO on qemu_set_fd_handler2() Marcelo Tosatti
2008-04-11 18:59   ` Anthony Liguori
2008-04-11 19:44     ` Marcelo Tosatti
2008-04-13 15:05       ` Avi Kivity
2008-04-11 19:51     ` Marcelo Tosatti
2008-04-11 18:38 ` [patch 2/2] QEMU: decrease console "refresh rate" with -nographic Marcelo Tosatti
2008-04-13 16:30   ` Anders
2008-04-14 15:02     ` Marcelo Tosatti [this message]
2008-04-14 16:24       ` Avi Kivity
2008-04-14 17:24         ` Marcelo Tosatti
2008-04-14 18:31           ` Anthony Liguori
2008-04-15  5:39             ` Avi Kivity
2008-04-15  5:43               ` Carsten Otte
2008-04-15 13:40               ` Anthony Liguori
2008-04-15 13:47                 ` Avi Kivity
2008-04-15 15:12                 ` Marcelo Tosatti
2008-04-15  5:40           ` Avi Kivity
2008-04-15  7:26           ` Anders
2008-04-15  9:27             ` Avi Kivity
2008-04-15 14:20               ` Anthony Liguori
2008-04-15 14:45                 ` Avi Kivity
2008-04-15 15:04                   ` Marcelo Tosatti
2008-04-15 15:34                     ` Anthony Liguori
2008-04-15 15:43                       ` Avi Kivity
2008-04-15 18:14                         ` Anthony Liguori
2008-04-16  8:37                           ` Avi Kivity
2008-04-16 10:26                             ` Anders
2008-04-16 11:23                               ` Avi Kivity
2008-04-16 13:53                             ` Anthony Liguori
2008-04-16 14:24                               ` Carsten Otte
2008-04-17 12:53                                 ` Avi Kivity
2008-04-17  9:37                               ` Avi Kivity

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=20080414150255.GA11640@dmt \
    --to=mtosatti@redhat.com \
    --cc=avi@qumranet.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=mail@flac.kalibalik.dk \
    /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.