From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Live memory allocation? Date: Mon, 30 Mar 2009 16:48:36 +0300 Message-ID: <49D0CDB4.1010706@redhat.com> References: <49CB86BE.40505@poboxes.info> <49CB8B59.20601@redhat.com> <49CB8CF6.70403@wpkg.org> <200903280738.34169.alberto@byu.edu> <49CF6AA4.2060108@redhat.com> <49D0CBCA.3000808@wpkg.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Nolan , kvm@vger.kernel.org To: Tomasz Chmielewski Return-path: Received: from mx2.redhat.com ([66.187.237.31]:49651 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751051AbZC3Nsl (ORCPT ); Mon, 30 Mar 2009 09:48:41 -0400 In-Reply-To: <49D0CBCA.3000808@wpkg.org> Sender: kvm-owner@vger.kernel.org List-ID: Tomasz Chmielewski wrote: > > What about cache/buffers sharing between the host kernel and running > processes? > > > If I'm not mistaken, right now, memory is "wasted" by caching the same > data by host and guest kernels. > > For example, let's say we have a host with 2 GB RAM and it runs a 1 GB > guest. > If we read ~900 MB file_1 (block device) on guest, then: > - guest's kernel will cache file_1 > - host's kernel will cache the same area of file_1 (block device) > > Now, if we want to read ~900 MB file_2 (or lots of files with that > size), cache for file_1 will be emptied on both guest and host as we > read file_2. > Ideal situation would be if host and guest caches could be "shared", > to a degree (and have both file_1 and file_2 in memory, doesn't matter > if it's guest or host). Double caching is indeed a bad idea. That's why you have cache=off (though it isn't recommended with qcow2). -- error compiling committee.c: too many arguments to function