From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 0/4] KVM: Dirty logging optimization using rmap Date: Tue, 29 Nov 2011 13:20:11 +0200 Message-ID: <4ED4BFEB.5010600@redhat.com> References: <20111114182041.43570cdf.yoshikawa.takuya@oss.ntt.co.jp> <4EC0EC90.1090202@redhat.com> <4EC0F3D3.9090907@oss.ntt.co.jp> <4EC10BFE.7050704@redhat.com> <4EC33C0B.1060807@oss.ntt.co.jp> <4EC37D18.4010609@redhat.com> <4ED4AF43.2040003@linux.vnet.ibm.com> <4ED4B574.8090907@oss.ntt.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Xiao Guangrong , Marcelo Tosatti , KVM To: Takuya Yoshikawa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:15743 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751857Ab1K2LUS (ORCPT ); Tue, 29 Nov 2011 06:20:18 -0500 In-Reply-To: <4ED4B574.8090907@oss.ntt.co.jp> Sender: kvm-owner@vger.kernel.org List-ID: On 11/29/2011 12:35 PM, Takuya Yoshikawa wrote: >>> I think it needs more thinking if only less page need be write >>> protected. >>> >>> For example, framebuffer-based device used by Xwindow, only ~64M >>> pages needs >>> to be write protected, but in your way, guest will get write page >>> fault on all >>> memory? Hmm? >>> >>> It has some tricks but i missed? > > > Do you mean write protecting slot by slot is difficult in the case of > O(1)? Well, O(1) as outlined protects everything. So if we protect a small slot, all the others get a penalty. We used to have a bitmap in a shadow page with a bit set for every slot pointed to by the page. If we extend this to non-leaf pages (so, when we set a bit, we propagate it through its parent_ptes list), then we do the following on write fault: for each level, from root towards leaf find index if if pte(index) is write-protected: remove write protection if pte(index) points to a leaf mark page dirty else for each pte in page pointed to by pte(index): if it is not dirty already, and its slots bitmap indicates it needs write protection write protect pte or something. -- error compiling committee.c: too many arguments to function