[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <07ca6bb4-2153-48ec-9171-dd7d66720d96@email.android.com>
Date: Mon, 01 Jul 2013 07:45:41 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Borislav Petkov <bp@...en8.de>
CC: Ingo Molnar <mingo@...nel.org>,
Wedson Almeida Filho <wedsonaf@...il.com>,
Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>, x86@...nel.org,
linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [PATCH] x86: Use asm-goto to implement mutex fast path on x86-64
Right... brain not awake yet, sorry, and responding from my phone.
I am not to worried about trading off a bit of additional branch mispredicts if everything else wins, but Ingo does have a valid question if we are measuring the right thing.
The effect is definitely big enough that it would be good to understand it one way or the other.
And regardless of the source... nice job!
Borislav Petkov <bp@...en8.de> wrote:
>On Mon, Jul 01, 2013 at 07:30:14AM -0700, H. Peter Anvin wrote:
>> Unconditional branches don't need prediction. The branch predictor
>> is used for conditional branches and in some hardware designs for
>> indirect branches. Unconditional direct branches never go through
>> the branch predictor simply because the front end can know with 100%
>> certainty where the flow of control will be.
>
>I meant the conditional Jcc branches:
>
>ffffffff81774920 <mutex_lock>:
>
>...
>
>ffffffff8177492d: f0 ff 0b lock decl (%rbx)
>ffffffff81774930: 79 08 jns ffffffff8177493a
><mutex_lock+0x1a>
>
>
>
>ffffffff81774730 <mutex_unlock>:
>
>...
>
>ffffffff81774738: f0 ff 07 lock incl (%rdi)
>ffffffff8177473b: 7f 0a jg ffffffff81774747
><mutex_unlock+0x17>
--
Sent from my mobile phone. Please excuse brevity and lack of formatting.
--
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