lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 9 Jul 2012 12:14:49 -0400
From:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To:	David Vrabel <david.vrabel@...rix.com>
Cc:	xen-devel@...ts.xensource.com, linux-kernel@...r.kernel.org
Subject: Re: [Xen-devel] [PATCH 1/4] xen/p2m: Optimize the
 get_phys_to_machine function a bit.

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@...cle.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];
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ