From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7yeM-0008Kc-KV for qemu-devel@nongnu.org; Tue, 10 Nov 2009 16:53:18 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7yeI-0008F1-TZ for qemu-devel@nongnu.org; Tue, 10 Nov 2009 16:53:18 -0500 Received: from [199.232.76.173] (port=35295 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7yeI-0008EO-FI for qemu-devel@nongnu.org; Tue, 10 Nov 2009 16:53:14 -0500 Received: from e38.co.us.ibm.com ([32.97.110.159]:51348) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N7yeH-0006Bv-Vp for qemu-devel@nongnu.org; Tue, 10 Nov 2009 16:53:14 -0500 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e38.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id nAALmXQr030960 for ; Tue, 10 Nov 2009 14:48:33 -0700 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nAALqqnO079998 for ; Tue, 10 Nov 2009 14:52:52 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nAAEm56j031752 for ; Tue, 10 Nov 2009 07:48:05 -0700 Message-ID: <4AF9E0AA.8040100@us.ibm.com> Date: Tue, 10 Nov 2009 15:52:42 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1257782838.2835.5.camel@aglitke> <1257784326.2835.16.camel@aglitke> <200911101312.02650.rusty@rustcorp.com.au> In-Reply-To: <200911101312.02650.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 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. This really models how target/actual work and I think it suggests that we want to reuse that mechanism for the stats too. > Rusty. > -- Regards, Anthony Liguori