From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAmec-00008M-Vc for qemu-devel@nongnu.org; Fri, 15 Apr 2011 13:17:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QAmeb-0001Xm-Tv for qemu-devel@nongnu.org; Fri, 15 Apr 2011 13:17:58 -0400 Received: from e3.ny.us.ibm.com ([32.97.182.143]:51252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAmeb-0001XU-Na for qemu-devel@nongnu.org; Fri, 15 Apr 2011 13:17:57 -0400 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by e3.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p3FGunmw003054 for ; Fri, 15 Apr 2011 12:56:49 -0400 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p3FHHpOY1998850 for ; Fri, 15 Apr 2011 13:17:52 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p3FHHpc9026938 for ; Fri, 15 Apr 2011 14:17:51 -0300 Message-ID: <4DA87DBD.3030406@us.ibm.com> Date: Fri, 15 Apr 2011 12:17:49 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1302878695-10256-1-git-send-email-dave@linux.vnet.ibm.com> <4DA87093.7050008@us.ibm.com> <1302885415.16562.3358.camel@nimitz> In-Reply-To: <1302885415.16562.3358.camel@nimitz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] set VIRTIO_BALLOON_F_MUST_TELL_HOST unconditionally List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dave Hansen Cc: Amit Shah , qemu-devel@nongnu.org On 04/15/2011 11:36 AM, Dave Hansen wrote: > On Fri, 2011-04-15 at 11:21 -0500, Anthony Liguori wrote: >>> This patch makes the "tell host first" logic the only case. This >>> should make everybody happy, and reduce the amount of untested or >>> untestable code in the kernel. >> It doesn't make me happy. > Darn. > >> Why would we do this in QEMU? This prevents the guest from doing >> ballooning reclaim during OOM. > What the heck is "ballooning reclaim"? Could you elaborate a bit on how > this happens? I think I'm missing some subtlety here. If you're in OOM and you need memory, you can't ask the host for more and wait for a response. You have to reclaim it immediately. See the s390 balloon driver for an example of this. > I think 'tell host first' is the only sane way to do it. Look at the > 'tell host second code': > > release_pages_by_pfn(); // let other kernel users at the pages > tell_host(); // tell the hypervisor they're used again > At the point we've started using the pages again, we haven't *told* the > host that we're using them. I think that's potentially a problem. Is > qemu somehow cool with the guest touching pages that are supposed to be > in the balloon and unusable? Yes, of course it is. All ballooning does is madvise(MADV_DONTNEED). A guest can reclaim the memory as soon as it wants it to. Regards, Anthony Liguori > -- Dave >