From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NTIb3-0001Ed-8O for qemu-devel@nongnu.org; Fri, 08 Jan 2010 12:26:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NTIay-00010j-4O for qemu-devel@nongnu.org; Fri, 08 Jan 2010 12:26:00 -0500 Received: from [199.232.76.173] (port=58850 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTIax-00010S-UR for qemu-devel@nongnu.org; Fri, 08 Jan 2010 12:25:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:9589) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NTIaw-0007uh-QJ for qemu-devel@nongnu.org; Fri, 08 Jan 2010 12:25:55 -0500 Date: Fri, 8 Jan 2010 15:25:32 -0200 From: Luiz Capitulino Subject: Re: [Qemu-devel] Re: [RFD] virtio: Add memory statistics reporting to the balloon driver Message-ID: <20100108152532.43883a6a@doriath> In-Reply-To: <1262970091.2767.22.camel@aglitke> References: <1262711318.10698.104.camel@aglitke> <4B45F9CA.7050903@codemonkey.ws> <20100107154918.GB19168@redhat.com> <1262881658.2767.12.camel@aglitke> <4B460E55.9090800@redhat.com> <4B461233.2020808@codemonkey.ws> <20100107155830.71fc3f76@doriath> <20100107163014.47662b8c@doriath> <1262970091.2767.22.camel@aglitke> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Adam Litke Cc: Avi Kivity , qemu-devel On Fri, 08 Jan 2010 11:01:31 -0600 Adam Litke wrote: > On Thu, 2010-01-07 at 16:30 -0200, Luiz Capitulino wrote: > > On Thu, 7 Jan 2010 15:58:30 -0200 > > Luiz Capitulino wrote: > > > > > I like Daniel's idea too. In practice 'refresh-balloon' is going to > > > be Anthony's idea #1 for the QMP case, which seems the right way to > > > do it with QMP. > > > > Hm, something that has just occurred to me: it's easy to have > > async messages in the user Monitor, we could add a new type of > > user print callback called async_print. > > > > This new callback would be called by the Monitor when the async > > message API is called but we are in user mode. > > > > This is really today's user_print, but user data is printed > > asynchronously. > > There is one thing I am struggling with as I try to implement this > asynchronous behavior. How can I suspend the monitor thread to wait for > the stats update to come through? I see qemu_cond_timedwait(), but that > appears to only be used for a VM's cpu threads. I also see the bottom > half infrastructure, but I am not sure if that is appropriate either. IIUC, in QMP you won't wait at all and I believe suspend/resume should work on the user Monitor. You can use monitor_ctrl_mode() to know whether you're in QMP or not.