From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: ABAT Testing report, kernel 76f0301b5.., user 04cff0e47.. Date: Mon, 23 Jul 2007 19:12:14 +0300 Message-ID: <46A4D35E.5010708@qumranet.com> References: <10EA09EFD8728347A513008B6B0DA77A01CBF1D2@pdsmsx411.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: "Zhao, Yunfeng" Return-path: In-Reply-To: <10EA09EFD8728347A513008B6B0DA77A01CBF1D2-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Zhao, Yunfeng wrote: > Hi, all > > This is today's ABAT testing result against kvm.git 76f0301b5e4d2603d8e1ee5295db29faea660b49 and kvm-userspace.git 04cff0e47c4cc1e3d51f917a657b97ac2ed29719 > We are still using UP guests in the testing, we will try to enable some SMP Windows and Linux tests in this week. > > One new issue is about performance regression since KVM-29 > 1. Performance regression since KVM-29 > https://sourceforge.net/tracker/index.php?func=detail&aid=1758756&group_id=180599&atid=893831 > > I bisected this to commit 8a1449563b3e5ede56b28cc977c8da22a17cdf51 Author: Luca Tettamanti Date: Tue Jun 19 22:41:38 2007 +0200 KVM: Avoid useless memory write when possible When writing to normal memory and the memory area is unchanged the write can be safely skipped, avoiding the costly kvm_mmu_pte_write. Signed-Off-By: Luca Tettamanti Signed-off-by: Avi Kivity diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 7826f16..5603000 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c @@ -1170,8 +1170,10 @@ static int emulator_write_phys(struct kvm_vcpu *vcpu, gpa_t gpa, return 0; mark_page_dirty(vcpu->kvm, gpa >> PAGE_SHIFT); virt = kmap_atomic(page, KM_USER0); - kvm_mmu_pte_write(vcpu, gpa, virt + offset, val, bytes); - memcpy(virt + offset_in_page(gpa), val, bytes); + if (memcmp(virt + offset_in_page(gpa), val, bytes)) { + kvm_mmu_pte_write(vcpu, gpa, virt + offset, val, bytes); + memcpy(virt + offset_in_page(gpa), val, bytes); + } kunmap_atomic(virt, KM_USER0); return 1; } The effect with this patch applied is that pf_fixed grows very high. I'm guessing that this is because not calling kvm_mmu_pte_write() defeats the fork detector and causes a high amount of emulated writes to page table when fork() resets the writable bit on read-only ptes. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/