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 15:41:09 +0200 Message-ID: <4D9332F5.1060208@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> <4D931F73.90704@redhat.com> <20110330124828.GX7766@redhat.com> <20110330132618.GY7766@redhat.com> <4D93301E.3080200@redhat.com> <20110330133613.GZ7766@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]:1026 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755127Ab1C3NlN (ORCPT ); Wed, 30 Mar 2011 09:41:13 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2UDfCJ0032057 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 30 Mar 2011 09:41:12 -0400 In-Reply-To: <20110330133613.GZ7766@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 03/30/2011 03:36 PM, Gleb Natapov wrote: > > > > It's wierd. Do you get perf hits in the copying? > > > How can I check. The memcpy is inlined. > perf annotate x86_emulate_instruction (newer perf allows you to get there interactively from 'perf report') > > Copying a couple of hot cache lines shouldn't take any measurable > > time compared to a heavyweight exit. > > > The whole function takes only 1.5% CPU. Perf measures how much this > function become faster and heavyweight exit is not part of the function. It's still relative to exit cost. If the total exit was 2 us, then a 1% decrease in cost translates to 40 ns. (well, that's not unlikely for a 256 byte memcpy, but let's be sure). -- error compiling committee.c: too many arguments to function