[PATCH 1/3] x86: Move msr accesses out of line

2015-03-19 Thread Andi Kleen
From: Andi Kleen To add trace points to msr accesses we need to include linux/tracepoint.h. Unfortunately this causes hellish include loops when with the msr inlines in asm/msr.h, which are included all over. I tried to fix several of them, but eventually gave up. This patch moves the MSR functi

Re: [PATCH 1/3] x86: Move msr accesses out of line

2015-02-25 Thread Borislav Petkov
On Wed, Feb 25, 2015 at 07:20:32PM +0100, Andi Kleen wrote: > Also we do quite a few RDMSRs, which are not necessarily > serializing. RDMSR is not serializing. Not even WRMSR when to certain ranges, see section 8.3 in the SDM 3A. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when y

Re: [PATCH 1/3] x86: Move msr accesses out of line

2015-02-25 Thread Andi Kleen
> Still, I wondered, so I ran me a little test. Note that I used a > serializing instruction (LOCK XCHG) because WRMSR is too. WRMSR has a lot of uops internally unlike LOCK XCHG, so I expect it will mostly overlap with what it does. I'll run some benchmarks on this today. Also we do quite a few

Re: [PATCH 1/3] x86: Move msr accesses out of line

2015-02-25 Thread Peter Zijlstra
On Mon, Feb 23, 2015 at 09:43:40AM -0800, Andi Kleen wrote: > On Mon, Feb 23, 2015 at 06:04:36PM +0100, Peter Zijlstra wrote: > > On Fri, Feb 20, 2015 at 05:38:55PM -0800, Andi Kleen wrote: > > > > > This patch moves the MSR functions out of line. A MSR access is typically > > > 40-100 cycles or e

Re: [PATCH 1/3] x86: Move msr accesses out of line

2015-02-23 Thread Andi Kleen
On Mon, Feb 23, 2015 at 06:04:36PM +0100, Peter Zijlstra wrote: > On Fri, Feb 20, 2015 at 05:38:55PM -0800, Andi Kleen wrote: > > > This patch moves the MSR functions out of line. A MSR access is typically > > 40-100 cycles or even slower, a call is a few cycles at best, so the > > additional func

Re: [PATCH 1/3] x86: Move msr accesses out of line

2015-02-23 Thread Peter Zijlstra
On Fri, Feb 20, 2015 at 05:38:55PM -0800, Andi Kleen wrote: > This patch moves the MSR functions out of line. A MSR access is typically > 40-100 cycles or even slower, a call is a few cycles at best, so the > additional function call is not really significant. If I look at the below PDF a CALL+PU

[PATCH 1/3] x86: Move msr accesses out of line

2015-02-20 Thread Andi Kleen
From: Andi Kleen To add trace points to msr accesses we need to include linux/tracepoint.h. Unfortunately this causes hellish include loops when with the msr inlines in asm/msr.h, which is included all over. I tried to fix several of them, but eventually gave up. This patch moves the MSR functi