From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] KVM simplified virtio balloon driver Date: Sat, 19 Jan 2008 18:40:36 -0600 Message-ID: <47929884.2010908@codemonkey.ws> References: <20080114200357.GA18354@dmt> <20080115190102.GA27645@dmt> <1200525166.26281.103.camel@localhost.localdomain> <200801171245.59510.rusty@rustcorp.com.au> <4791A085.8060502__30665.5007684187$1200726687$gmane$org@qumranet.com> <47927BB7.7060805@codemonkey.ws> <20080120002433.GA6880@dmt> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel , Avi Kivity , virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Marcelo Tosatti Return-path: In-Reply-To: <20080120002433.GA6880@dmt> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Marcelo Tosatti wrote: > On Sat, Jan 19, 2008 at 04:37:43PM -0600, Anthony Liguori wrote: > >> Avi Kivity wrote: >> >>> Rusty Russell wrote: >>> >>>> After discussions with Anthony Liguori, it seems that the virtio >>>> balloon can be made even simpler. Here's my attempt. >>>> >>>> Since the balloon requires Guest cooperation anyway, there seems >>>> little reason to force it to tell the Host when it wants to reuse a >>>> page. It can simply fault it in. >>>> >>>> >>>> >>> Faulting is synchronous, while deflating is (or can be made) >>> asynchronous. If the host needs to do some work to get the memory, the >>> guest will be slowed down considerably. >>> >> Good point. Basically, we have two page hinting operations which >> roughly correspond to madvise(MADV_DONTNEED) and madvise(MADV_WILLNEED). >> > > Also, the simplified driver does not handle errors at all. > > I don't think that assuming madvise() can't fail is a good thing. > I don't think the host should be communicating to the guest if madvise() fails. The notification is a hint to the host. The guest doesn't know what the host is doing in response to that hint. Regards, Anthony Liguori ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/