From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 5/6] kvm, x86: use ro page and don't copy shared page Date: Sun, 18 Jul 2010 18:14:11 +0300 Message-ID: <4C431A43.5010808@redhat.com> References: <4C3FC033.3000605@cn.fujitsu.com> <20100716071936.GE17894@redhat.com> <20100716232612.GB8946@amt.cnet> <20100717043124.GA24480@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , Lai Jiangshan , LKML , kvm@vger.kernel.org, Nick Piggin To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:7843 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756385Ab0GRPOT (ORCPT ); Sun, 18 Jul 2010 11:14:19 -0400 In-Reply-To: <20100717043124.GA24480@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 07/17/2010 07:31 AM, Gleb Natapov wrote: >>> >>> Currently pages allocated for guest memory are required to be RW, so after your series >>> behaviour will remain exactly the same as before. >>> >> Except KSM pages. >> >> > KSM page will be COWed by __get_user_pages_fast(addr, 1, 1, page) in > get_user_page_and_protection() just like it COWed now, no? > Well, we don't want to COW it on write faults. The optimal behaviour is: - write faults: COW and instantiate a writeable spte - read faults: instantiate a readable spte; if likely(page is writeable), make it a writeable spte; if likely(page is dirty) make it a dirty spte - speculative spte instantiations: if likely(page is present) instantiate a pte; if accessed, mark it accessed, if writeable, mark it writeable; if dirty, mark it dirty -- error compiling committee.c: too many arguments to function