From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomasz Chmielewski Subject: Re: Live memory allocation? Date: Mon, 30 Mar 2009 15:55:36 +0200 Message-ID: <49D0CF58.40109@wpkg.org> 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> <49D0CDB4.1010706@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Nolan , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx03.syneticon.net ([78.111.66.105]:38774 "EHLO mx03.syneticon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751600AbZC3Nzl (ORCPT ); Mon, 30 Mar 2009 09:55:41 -0400 In-Reply-To: <49D0CDB4.1010706@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity schrieb: > 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). cache= option is about write cache, right? Here, I'm talking about read cache. Or, does "cache=none" disable read cache as well? -- Tomasz Chmielewski http://wpkg.org