From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] KVM: emulator: do not needlesly sync registers from emulator ctxt to vcpu Date: Wed, 30 Mar 2011 15:43:50 +0200 Message-ID: <20110330134350.GA7766@redhat.com> References: <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> <4D9332F5.1060208@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: mtosatti@redhat.com, kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:20156 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755150Ab1C3Nnw (ORCPT ); Wed, 30 Mar 2011 09:43:52 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2UDhpkC005467 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 30 Mar 2011 09:43:51 -0400 Content-Disposition: inline In-Reply-To: <4D9332F5.1060208@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Mar 30, 2011 at 03:41:09PM +0200, Avi Kivity wrote: > 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 Ah, forgot about it: First one: 27.71 : 1179f: f3 a5 rep movsl %ds:(%rsi),%es:(%rdi) Second one: 32.68 : 11888: f3 a5 rep movsl %ds:(%rsi),%es:(%rdi) > >> 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 -- Gleb.