From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [RFC 7/8]KVM: swap out guest pages Date: Wed, 25 Jul 2007 16:25:08 +0300 Message-ID: <46A74F34.5040508@qumranet.com> References: <1185173505.2645.71.camel@sli10-conroe.sh.intel.com> <46A612C8.6090804@qumranet.com> <288dbef70707250455p656b09cft20ebc7a013e8a76f@mail.gmail.com> <288dbef70707250620u5483d5dbxbcc461f8f685acdc@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel , lkml To: Shaohua Li Return-path: In-Reply-To: <288dbef70707250620u5483d5dbxbcc461f8f685acdc-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Shaohua Li wrote: >> So write to a file, right? Yes, it can avoid use move to swap, and >> should be feasible. > Say you want to write guest pages out to file A of back store fs, in > kvm->writepage(), we could do: > 1. lower_page = grap_cache_page(file A's mapping) > 2. file A's ->prepare_write(lower_page) > 3. copy kvm guest page to lower_page > 4. file A's ->commit_write(lower_page) > then guest page can be freed. Just like the stack fs does. The > downside is step 1 needs allocate a new page. Yeah. Hopefully we can find a better solution, the copy isn't pretty (though it's probably not too bad from a performance point of view compared to the IPIs involved). -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/