From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0tqT-0005X9-H7 for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:47:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0tqS-00050R-KD for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:47:45 -0400 Message-ID: <5571C495.5000809@redhat.com> Date: Fri, 05 Jun 2015 17:47:33 +0200 From: Max Reitz MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/4] qcow2: mark the memory as no longer needed after qcow2_cache_empty() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org, Stefan Hajnoczi On 02.06.2015 14:22, Alberto Garcia wrote: > After having emptied the cache, the data in the cache tables is no > longer useful, so we can tell the kernel that we are done with it. In > Linux this frees the resources associated with it. > > The effect of this can be seen in the HMP commit operation: it moves > data from the top to the base image (and fills both caches), then it > empties the top image. At this point the data in that cache is no > longer needed so it's just wasting memory. > > Signed-off-by: Alberto Garcia > Cc: Max Reitz > --- > block/qcow2-cache.c | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) Reviewed-by: Max Reitz