From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: madvise() not triggering page discard with MMU-notifiers Date: Wed, 20 Aug 2008 15:38:08 -0500 Message-ID: <48AC80B0.7090508@us.ibm.com> References: <48A9F1E9.6040907@us.ibm.com> <20080820011655.GA11137@dmt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Andrea Arcangeli , kvm-devel To: Marcelo Tosatti Return-path: Received: from e2.ny.us.ibm.com ([32.97.182.142]:57014 "EHLO e2.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755267AbYHTUiv (ORCPT ); Wed, 20 Aug 2008 16:38:51 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e2.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id m7KKconH015144 for ; Wed, 20 Aug 2008 16:38:50 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m7KKco8f225732 for ; Wed, 20 Aug 2008 16:38:50 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m7KKco28014037 for ; Wed, 20 Aug 2008 16:38:50 -0400 In-Reply-To: <20080820011655.GA11137@dmt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: Marcelo Tosatti wrote: > Hi Anthony, > > On Mon, Aug 18, 2008 at 05:04:25PM -0500, Anthony Liguori wrote: > >> Attached is an updated migration patch. It does not appear, however, >> that madvise() is triggering discarding of pages even with an >> MMU-notifier enabled kernel. I take it that this is because we're still >> holding a reference count to the page when it is in the shadow page >> table? Any ETA on when this will change? >> > > Shadow references should be dropped via kvm_unmap_rmapp -> rmap_remove. > > So the symptom is that RSS for the task does not decrease accordingly to > the ballooned down size? > Correct. I run a workload in the guest to touch all of memory, watch the RSS size go up to 1G, then balloon down to 512mb. I don't see the RSS size reduce at all though. This is not the case when just using QEMU. When I get a chance to debug, the next step will be to annotate the code to see whether rmap_remove is actually being invoked on madvise(). Regards, Anthony Liguori