From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takuya Yoshikawa Subject: Re: [RFC PATCH 2/2] KVM: selective write protection using dirty bitmap Date: Fri, 19 Nov 2010 17:30:26 +0900 Message-ID: <4CE635A2.2030802@oss.ntt.co.jp> References: <20101118141232.d1d25679.yoshikawa.takuya@oss.ntt.co.jp> <20101118141559.8580766c.yoshikawa.takuya@oss.ntt.co.jp> <4CE524BB.9000007@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: mtosatti@redhat.com, laijs@cn.fujitsu.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]:36369 "EHLO serv2.oss.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750933Ab0KSI2O (ORCPT ); Fri, 19 Nov 2010 03:28:14 -0500 In-Reply-To: <4CE524BB.9000007@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: (2010/11/18 22:06), Avi Kivity wrote: > On 11/18/2010 07:15 AM, Takuya Yoshikawa wrote: >> >> We can also use this to selectively write protect pages to reduce unwanted page >> faults in the future. >> > > Looks like a good approach. Any measurements? > OK, I'll do some tests to select a right approach. Personally, and some as a job if possible, I'm planning various things. a) Frame buffer: small bitmap size (my hobby now) Performance: Both function level and guest side measurements is necessary. *1 For interactivity, qemu side intelligence may be needed. Note: qemu side dirty bitmap optimization by Kemari team is pending now. Correctness: I doubt qemu side but I'm not good at device level VGA details yet, sorry. *1) I once tried to update dirty bitmap without srcu sync by using atomic_clear_mask() word by word. This seemed to be working and get_dirty_log() was not bad. But when I tested x11perf inside the guest, the numbers were worse than the original implementation (LOCK_PREFIX might do bad things to the cache and srcu reader side suffered, I guess). Good SRCU! b) Live-migration: large bitmap size (my target is ~4GB RAM now) Performance: Scalability is important in both RAM size and number of dirty pages point of view. We need to achieve this goal without sacrificing the low workload case. Correctness: I'm trying to make live-migration fail in the condition of without mst's fix by multi threaded high work load. SMP is necessary. > >> + >> + if (!(gfn_offset || (gfn % huge))) >> + break; > > Why? I preserved these lines from Lai's original. >> http://www.spinics.net/lists/kvm/msg35871.html But OK, I found some duplication probably. I'll fix. > > wrt. O(1) write protection: hard to tell if the two methods can coexist. For direct mapped shadow pages (i.e. ep/npt) I think we can use the mask to speed up clearing of an individual sp's sptes. > OK, I'll test both with and without NPT. The result may lead us to the right direction. Takuya