qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	Luiz Capitulino <lcapitulino@redhat.com>,
	Avi Kivity <avi@redhat.com>, Adam Litke <agl@us.ibm.com>
Subject: Re: [Qemu-devel] Re: [RFD] virtio: Add memory statistics reporting to the balloon driver
Date: Thu, 7 Jan 2010 15:49:18 +0000	[thread overview]
Message-ID: <20100107154918.GB19168@redhat.com> (raw)
In-Reply-To: <4B45F9CA.7050903@codemonkey.ws>

On Thu, Jan 07, 2010 at 09:12:10AM -0600, Anthony Liguori wrote:
> On 01/05/2010 11:08 AM, Adam Litke wrote:
> >This patch has been discussed (and ACKed) in the past, but has not yet
> >been committed due to the congestion surrounding the 0.12 release and
> >other conflicting changes.  I would like to rekindle the discussion so
> >that I can make the necessary changes to get this merged.
> >
> >This patch is ported to 0.12.1 and has one issue that I am aware of:
> >
> >It still calls monitor_suspend() and monitor_resume() which I understand
> >is no longer allowed.  Does anyone have any ideas on how to enable async
> >monitor commands?
> >
> >+static void request_stats(VirtIOBalloon *vb)
> >+{
> >+    vb->stats_requested = 1;
> >+    reset_stats(vb);
> >+    monitor_suspend(cur_mon);
> >   
> 
> This bit is not going to work reliably anymore.  Really, it never worked 
> reliably but this is exacerbated with -qmp since a QMP session will 
> never be the cur_mon.
> 
> We have a couple of options:
> 
> 1) Introduce a query-balloon command that returns immediately, and 
> triggers a request for the guest to update the balloon stats.  When the 
> guest does update the balloon stats, trigger an asynchronous message.  
> Asynchronous messages are ignored by the human monitor so they would 
> never be displayed there which is unfortunate.
> 
> 2) Make info balloon show the last valid stats and have it request new 
> stats.  Stats will always be delayed but it avoids async messages.
> 
> 3) Make qemu request balloon stats regularly (maybe every 10 seconds) 
> and display the latest stats with info balloon.  This avoids the problem 
> in #2 but it means that qemu determines the poll rate instead of a 
> management tool.

I don't like the idea of the anything which has hardcoded polling because
it just wastes CPU cycles for the 99% of the time when no one is going to
care about these stats.
 
> 4) Make info-balloon a proper asynchronous command.  We need new 
> infrastructure to allow a qmp handler to take a callback that can be 
> used to delay the completion of the command.  This addresses all of the 
> above problems but it introduces a new one.  Command completion now 
> depends on the guest.  This potentially could trip up a naive management 
> tool that doesn't realize that the info-balloon command may never complete.

I think 'info-balloon' should be synchronous and without side-effects.
ie return the current stats that QEMU has. We could then add a separate
'refresh-balloon' command + async event notification when that completes.
The tool that is requiring the stats could thus refresh as often as it
likes.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

  parent reply	other threads:[~2010-01-07 16:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-05 17:08 [Qemu-devel] [RFD] virtio: Add memory statistics reporting to the balloon driver Adam Litke
2010-01-07 15:12 ` [Qemu-devel] " Anthony Liguori
2010-01-07 15:18   ` Avi Kivity
2010-01-07 15:22     ` Anthony Liguori
2010-01-07 15:39       ` Adam Litke
2010-01-08  1:33       ` Jamie Lokier
2010-01-07 15:49   ` Daniel P. Berrange [this message]
2010-01-07 16:27     ` Adam Litke
2010-01-07 16:39       ` Avi Kivity
2010-01-07 16:56         ` Anthony Liguori
2010-01-07 17:58           ` Luiz Capitulino
2010-01-07 18:30             ` Luiz Capitulino
2010-01-08 16:31               ` Anthony Liguori
2010-01-08 16:51                 ` Luiz Capitulino
2010-01-08 17:01               ` Adam Litke
2010-01-08 17:25                 ` Luiz Capitulino

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=20100107154918.GB19168@redhat.com \
    --to=berrange@redhat.com \
    --cc=agl@us.ibm.com \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=lcapitulino@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).