From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [Xen-devel] [PATCH 1/4] xen/p2m: Optimize the get_phys_to_machine function a bit. Date: Mon, 9 Jul 2012 16:41:24 +0100 Message-ID: <4FFAFBA4.4050603@citrix.com> References: <1341330038-21686-1-git-send-email-konrad.wilk@oracle.com> <1341330038-21686-2-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1341330038-21686-2-git-send-email-konrad.wilk@oracle.com> Sender: linux-kernel-owner@vger.kernel.org To: Konrad Rzeszutek Wilk Cc: xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org List-Id: xen-devel@lists.xenproject.org On 03/07/12 16:40, Konrad Rzeszutek Wilk wrote: > Running perf tells me that the check for p2m_identity > is done a lot - more than it should. This patch doesn't change the how often the check is done. Is this just bad wording of the description? > > Signed-off-by: Konrad Rzeszutek Wilk > --- > arch/x86/xen/p2m.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c > index 64effdc..161bcdc 100644 > --- a/arch/x86/xen/p2m.c > +++ b/arch/x86/xen/p2m.c > @@ -406,7 +406,7 @@ unsigned long get_phys_to_machine(unsigned long pfn) > * and in p2m_*missing, so returning the INVALID_P2M_ENTRY > * would be wrong. > */ > - if (p2m_top[topidx][mididx] == p2m_identity) > + if (unlikely(p2m_top[topidx][mididx] == p2m_identity)) > return IDENTITY_FRAME(pfn); > > return p2m_top[topidx][mididx][idx];