From mboxrd@z Thu Jan 1 00:00:00 1970 From: Izik Eidus Subject: Re: [PATCH 2/2] kvm: change the dirty page tracking to work with dirty bity Date: Thu, 11 Jun 2009 02:59:59 +0300 Message-ID: <4A3048FF.2030303@redhat.com> References: <1244651005-18322-1-git-send-email-ieidus@redhat.com> <1244651005-18322-2-git-send-email-ieidus@redhat.com> <1244651005-18322-3-git-send-email-ieidus@redhat.com> <20090610204227.GA12682@amt.cnet> <4A30484E.1040708@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, avi@redhat.com To: Marcelo Tosatti Return-path: Received: from mx2.redhat.com ([66.187.237.31]:41556 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760150AbZFKAAG (ORCPT ); Wed, 10 Jun 2009 20:00:06 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5B009R9006106 for ; Wed, 10 Jun 2009 20:00:09 -0400 In-Reply-To: <4A30484E.1040708@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Izik Eidus wrote: > Marcelo Tosatti wrote: > >>> >>> >>> /* Free page dirty bitmap if unneeded */ >>> - if (!(new.flags & KVM_MEM_LOG_DIRTY_PAGES)) >>> + if (!(new.flags & KVM_MEM_LOG_DIRTY_PAGES)) { >>> new.dirty_bitmap = NULL; >>> + if (old.flags & KVM_MEM_LOG_DIRTY_PAGES) >>> + kvm_arch_flush_shadow(kvm); >>> + } >>> >> >> Whats this for? >> > > We have added all this SPTE_DONT_DIRTY..., when we stop dirty bit > tracking, we want to continue setting the dirty bit for the spte > inside set_spte(), so writing to the page would be faster.... Another way would be doing something like kvm_arch_clean_dont_dirty(), might be better than flushing the whole shadow page tables.