From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N80kv-0006jf-R4 for qemu-devel@nongnu.org; Tue, 10 Nov 2009 19:08:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N80kr-0006ij-PJ for qemu-devel@nongnu.org; Tue, 10 Nov 2009 19:08:13 -0500 Received: from [199.232.76.173] (port=52771 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N80kr-0006iX-Ek for qemu-devel@nongnu.org; Tue, 10 Nov 2009 19:08:09 -0500 Received: from e33.co.us.ibm.com ([32.97.110.151]:49067) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N80kq-0007WY-WC for qemu-devel@nongnu.org; Tue, 10 Nov 2009 19:08:09 -0500 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by e33.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id nAB05SLf015091 for ; Tue, 10 Nov 2009 17:05:28 -0700 Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nAB07weU050070 for ; Tue, 10 Nov 2009 17:07:59 -0700 Received: from d03av05.boulder.ibm.com (loopback [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nAB07ws5011357 for ; Tue, 10 Nov 2009 17:07:58 -0700 Message-ID: <4AFA005C.7020607@us.ibm.com> Date: Tue, 10 Nov 2009 18:07:56 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1257782838.2835.5.camel@aglitke> <200911101312.02650.rusty@rustcorp.com.au> <4AF9E0AA.8040100@us.ibm.com> <200911111032.14956.rusty@rustcorp.com.au> In-Reply-To: <200911111032.14956.rusty@rustcorp.com.au> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: virtio: Add memory statistics reporting to the balloon driver List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Rusty Russell Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, agl@linux.vnet.ibm.com, qemu-devel@nongnu.org, Avi Kivity Rusty Russell wrote: > On Wed, 11 Nov 2009 08:22:42 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. Second, polling is >>> ugly. >>> >>> A stats vq might solve this more cleanly? >>> >>> >> This turns out to not work so nicely. You really need bidirectional >> communication. You need to request that stats be collected and then you >> need to tell the hypervisor about the stats that were collected. You >> don't need any real correlation between requests and stat reports either. >> > > You register an outbuf at initialization time. The host hands it back when > it wants you to refill it with stats. > That's strangely backwards. Guest send a stat buffer that's filled out, host acks it when it wants another. That doesn't seem bizarre to you? >> This really models how target/actual work and I think it suggests that >> we want to reuse that mechanism for the stats too. >> > > Sure, I want to. You want to. It's simple. > > But the universe is remarkably indifferent to what we want. Is it actually > sufficient or are we going to regret our laziness? > It's not laziness, it's consistency. How is actual different than free memory or any other stat? > Cheers, > Rusty. > -- Regards, Anthony Liguori