From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NT3jz-0007iO-1i for qemu-devel@nongnu.org; Thu, 07 Jan 2010 20:34:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NT3jt-0007iC-7y for qemu-devel@nongnu.org; Thu, 07 Jan 2010 20:34:13 -0500 Received: from [199.232.76.173] (port=50204 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NT3jt-0007i9-4X for qemu-devel@nongnu.org; Thu, 07 Jan 2010 20:34:09 -0500 Received: from mail2.shareable.org ([80.68.89.115]:49019) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NT3js-00013V-GE for qemu-devel@nongnu.org; Thu, 07 Jan 2010 20:34:08 -0500 Date: Fri, 8 Jan 2010 01:33:59 +0000 From: Jamie Lokier Subject: Re: [Qemu-devel] Re: [RFD] virtio: Add memory statistics reporting to the balloon driver Message-ID: <20100108013359.GC5011@shareable.org> References: <1262711318.10698.104.camel@aglitke> <4B45F9CA.7050903@codemonkey.ws> <4B45FB52.402@redhat.com> <4B45FC3A.6000900@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B45FC3A.6000900@codemonkey.ws> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel , Adam Litke , Avi Kivity , Luiz Capitulino Anthony Liguori wrote: > On 01/07/2010 09:18 AM, Avi Kivity wrote: > >On 01/07/2010 05:12 PM, Anthony Liguori wrote: > >> > >>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. > >> > >>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'm on the fence between 3 and 4 myself. > >> > > > >Can I tip you over to #4? #3 means we have no idea when the stats > >were generated. With #4, we can't be sure, but it usually be close to > >when the command returns. > > > >The command should include a timeout so a broken guest won't hang a > >management tool thread. > > Generally, timeouts are evil but if we did something like, wait 10 > seconds and if we don't hear a response from the guest, return the last > data set, I think I would be okay with that. It means we may be > reporting stale data, but at the same time, the data is coming from a > guest so it can't be considered authoritative anyway. A flag in the response to say if it's fresh or stale would be good - or simply a timestamp in host time. The timeout does not need to be as long as 10 seconds. If the guest is so slow to respond, management can poll at whatever rate it wants until it gets a fresh response. For this a timestamp is better, because it may be happy with a response that is sufficiently recent but not due to the most recent request. -- Jamie