From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takuya Yoshikawa Subject: Re: [PATCH 0/4] KVM: Dirty logging optimization using rmap Date: Wed, 16 Nov 2011 13:28:59 +0900 Message-ID: <4EC33C0B.1060807@oss.ntt.co.jp> References: <20111114182041.43570cdf.yoshikawa.takuya@oss.ntt.co.jp> <4EC0EC90.1090202@redhat.com> <4EC0F3D3.9090907@oss.ntt.co.jp> <4EC10BFE.7050704@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: mtosatti@redhat.com, kvm@vger.kernel.org, takuya.yoshikawa@gmail.com To: Avi Kivity Return-path: Received: from serv2.oss.ntt.co.jp ([222.151.198.100]:56746 "EHLO serv2.oss.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751578Ab1KPE2a (ORCPT ); Tue, 15 Nov 2011 23:28:30 -0500 In-Reply-To: <4EC10BFE.7050704@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: (2011/11/14 21:39), Avi Kivity wrote: > There was a patchset from Peter Zijlstra that converted mmu notifiers to > be preemptible, with that, we can convert the mmu spinlock to a mutex, > I'll see what happened to it. Interesting! > There is a third method of doing write protection, and that is by > write-protecting at the higher levels of the paging hierarchy. The > advantage there is that write protection is O(1) no matter how large the > guest is, or the number of dirty pages. > > To write protect all guest memory, we just write protect the 512 PTEs at > the very top, and leave the rest alone. When the guest writes to a > page, we allow writes for the top-level PTE that faulted, and > write-protect all the PTEs that it points to. One important point is that the guest, not GET DIRTY LOG caller, will pay for the write protection at the timing of faults. For live migration, it may be good because we have to make the guest memory converge anyway. > We can combine it with your method by having a small bitmap (say, just > 64 bits) per shadow page. Each bit represents 8 PTEs (total 512 PTEs) > and is set if any of those PTEs are writeable. Yes, there seem to be some good ways to make every case work well. Takuya