xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org
Subject: Re: [Xen-devel] [PATCH 1/4] xen/p2m: Optimize the get_phys_to_machine function a bit.
Date: Mon, 9 Jul 2012 12:14:49 -0400	[thread overview]
Message-ID: <20120709161448.GA17595@phenom.dumpdata.com> (raw)
In-Reply-To: <4FFAFBA4.4050603@citrix.com>

On Mon, Jul 09, 2012 at 04:41:24PM +0100, David Vrabel wrote:
> 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?

Its bad wording plus it really does not change the assmebler code - I thought
it did but since there is only one "if" case it does not matter how
much I put unlikely in front of it - it is the only branch condition.

Perhaps if I make the code be put in a variable (register) that would
optimize this a bit more...


> > 
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > ---
> >  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];

  reply	other threads:[~2012-07-09 16:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-03 15:40 [PATCH] various Xen fixes for v3.6 (v1) Konrad Rzeszutek Wilk
2012-07-03 15:40 ` [PATCH 1/4] xen/p2m: Optimize the get_phys_to_machine function a bit Konrad Rzeszutek Wilk
2012-07-09 15:41   ` [Xen-devel] " David Vrabel
2012-07-09 16:14     ` Konrad Rzeszutek Wilk [this message]
2012-07-03 15:40 ` [PATCH 2/4] xen/perf: Define .glob for the different hypercalls Konrad Rzeszutek Wilk
2012-07-03 16:07   ` Jan Beulich
2012-07-03 16:14   ` [Xen-devel] " David Vrabel
2012-07-03 16:17   ` Ian Campbell
2012-07-03 17:44     ` Konrad Rzeszutek Wilk
     [not found]   ` <4FF334E9020000780008D610@nat28.tlf.novell.com>
2012-07-03 17:38     ` Konrad Rzeszutek Wilk
2012-07-03 15:40 ` [PATCH 3/4] xen/acpi: Fix potential memory leak Konrad Rzeszutek Wilk
2012-07-03 15:40 ` [PATCH 4/4] xen/hvc: Fix up checks when the info is allocated Konrad Rzeszutek Wilk
2012-07-03 16:11   ` Jan Beulich
     [not found]   ` <4FF335C6020000780008D613@nat28.tlf.novell.com>
2012-07-03 17:36     ` Konrad Rzeszutek Wilk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120709161448.GA17595@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).