From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: emulator: do not needlesly sync registers from emulator ctxt to vcpu Date: Wed, 30 Mar 2011 14:12:02 +0200 Message-ID: <4D931E12.8050204@redhat.com> References: <20110329120838.GQ7766@redhat.com> <4D93083D.6000806@redhat.com> <20110330104727.GS7766@redhat.com> <4D930B0D.4090809@redhat.com> <20110330112243.GV7766@redhat.com> <20110330114333.GW7766@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 To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:21980 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754285Ab1C3MMF (ORCPT ); Wed, 30 Mar 2011 08:12:05 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2UCC5s9028374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 30 Mar 2011 08:12:05 -0400 In-Reply-To: <20110330114333.GW7766@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 03/30/2011 01:43 PM, Gleb Natapov wrote: > > > > The patch saves copying of 256 bytes on each MMIO/PIO read. It may not > > save a lot comparing to time it takes to do one MMIO to userspace, but > > do 1 million of those and you saved a lot of CPU cycles. I do not think > > we should abandon the optimization so easily. Unfortunately I can't run > > perf on 2.6.38 kernel right now. It gives me strange errors and when it > > doesn't it makes kernel OOPS. > > > After reboot perf started to work. I ran modified emulator.flat unit > test. It was modified to run test_cmps() in an endless loop. > > Without patch: > 1.71% qemu-system-x86 [kvm] [k] x86_emulate_instruction > 1.51% qemu-system-x86 [kvm] [k] x86_emulate_instruction > 1.68% qemu-system-x86 [kvm] [k] x86_emulate_instruction > > With patch: > 0.84% qemu-system-x86 [kvm] [k] x86_emulate_instruction > 0.96% qemu-system-x86 [kvm] [k] x86_emulate_instruction > 0.89% qemu-system-x86 [kvm] [k] x86_emulate_instruction > Well, that is probably significant. -- error compiling committee.c: too many arguments to function