From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N80cR-0002g7-50 for qemu-devel@nongnu.org; Tue, 10 Nov 2009 18:59:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N80cM-0002Ys-CJ for qemu-devel@nongnu.org; Tue, 10 Nov 2009 18:59:26 -0500 Received: from [199.232.76.173] (port=42892 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N80cM-0002Yf-7B for qemu-devel@nongnu.org; Tue, 10 Nov 2009 18:59:22 -0500 Received: from ozlabs.org ([203.10.76.45]:50742) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N80cL-0006Th-JV for qemu-devel@nongnu.org; Tue, 10 Nov 2009 18:59:21 -0500 From: Rusty Russell Subject: Re: [Qemu-devel] Re: virtio: Add memory statistics reporting to the balloon driver Date: Wed, 11 Nov 2009 10:29:13 +1030 References: <1257782838.2835.5.camel@aglitke> <200911101312.02650.rusty@rustcorp.com.au> <4AF97A5E.1070801@codemonkey.ws> In-Reply-To: <4AF97A5E.1070801@codemonkey.ws> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200911111029.13791.rusty@rustcorp.com.au> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Anthony Liguori , linux-kernel@vger.kernel.org, qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org, Avi Kivity , Adam Litke On Wed, 11 Nov 2009 01:06:14 am Anthony Liguori wrote: > Rusty Russell wrote: > > On Tue, 10 Nov 2009 03:02:06 am Adam Litke wrote: > > > >> A simpler approach is to collect memory statistics in the virtio > >> balloon driver and communicate them to the host via the device config space. > >> > > > > There are two issues I see with this. First, there's an atomicity problem > > since you can't tell when the stats are consistent. > > Actually, config writes always require notification from the guest to > the host. This means the host knows when they config space is changed > so atomicity isn't a problem. I think you missed my point: the stats are inter-related, so they should be served together. > In fact, if it were a problem, then the balloon driver would be > fundamentally broken because target and actual are stored in the config > space. No, one is written by the host, the other the guest. Still works. > If you recall, we had this discussion originally wrt the balloon driver :-) And I never did get around to the lguest implementation, which would have seen if this really is an issue. > > Second, polling is ugly. > > As opposed to? As opposed to giving the stats whenever asked by the host. > > A stats vq might solve this more cleanly? > > > > actual and target are both really just stats. Had we implemented those > with a vq, I'd be inclined to agree with you but since they're > implemented in the config space, it seems natural to extend the config > space with other stats. It does, *if* we don't need accuracy. Otherwise, it seems like we need something else. Cheers, Rusty.