Re: [PATCH 1/4] perf, x86: Avoid checkpointed counters causing excessive TSX aborts v4

2013-08-31 Thread Andi Kleen
> > So can just drop the XXX comment. Ok? > > How about hiding the entire thing in a hsw function. I'm fairly sure > that eventually we'll need to check all counters for this nonsense. AFAIK there are no plans to do so. > > Something like so perhaps? It's ok for me, except it's not for TSX

Re: [PATCH 1/4] perf, x86: Avoid checkpointed counters causing excessive TSX aborts v4

2013-08-31 Thread Peter Zijlstra
On Fri, Aug 30, 2013 at 01:44:45PM -0700, Andi Kleen wrote: > On Fri, Aug 30, 2013 at 06:02:15PM +0200, Peter Zijlstra wrote: > > On Wed, Aug 21, 2013 at 04:47:23PM -0700, Andi Kleen wrote: > > > @@ -1224,6 +1240,15 @@ again: > > > x86_pmu.drain_pebs(regs); > > > } > > > > > > + /* >

Re: [PATCH 1/4] perf, x86: Avoid checkpointed counters causing excessive TSX aborts v4

2013-08-31 Thread Peter Zijlstra
On Fri, Aug 30, 2013 at 01:44:45PM -0700, Andi Kleen wrote: On Fri, Aug 30, 2013 at 06:02:15PM +0200, Peter Zijlstra wrote: On Wed, Aug 21, 2013 at 04:47:23PM -0700, Andi Kleen wrote: @@ -1224,6 +1240,15 @@ again: x86_pmu.drain_pebs(regs); } + /* + * To avoid

Re: [PATCH 1/4] perf, x86: Avoid checkpointed counters causing excessive TSX aborts v4

2013-08-31 Thread Andi Kleen
So can just drop the XXX comment. Ok? How about hiding the entire thing in a hsw function. I'm fairly sure that eventually we'll need to check all counters for this nonsense. AFAIK there are no plans to do so. Something like so perhaps? It's ok for me, except it's not for TSX (that's

Re: [PATCH 1/4] perf, x86: Avoid checkpointed counters causing excessive TSX aborts v4

2013-08-30 Thread Andi Kleen
On Fri, Aug 30, 2013 at 06:02:15PM +0200, Peter Zijlstra wrote: > On Wed, Aug 21, 2013 at 04:47:23PM -0700, Andi Kleen wrote: > > @@ -1224,6 +1240,15 @@ again: > > x86_pmu.drain_pebs(regs); > > } > > > > + /* > > +* To avoid spurious interrupts with perf stat always reset

Re: [PATCH 1/4] perf, x86: Avoid checkpointed counters causing excessive TSX aborts v4

2013-08-30 Thread Peter Zijlstra
On Wed, Aug 21, 2013 at 04:47:23PM -0700, Andi Kleen wrote: > @@ -1224,6 +1240,15 @@ again: > x86_pmu.drain_pebs(regs); > } > > + /* > + * To avoid spurious interrupts with perf stat always reset checkpointed > + * counters. > + * > + * XXX move

Re: [PATCH 1/4] perf, x86: Avoid checkpointed counters causing excessive TSX aborts v4

2013-08-30 Thread Peter Zijlstra
On Wed, Aug 21, 2013 at 04:47:23PM -0700, Andi Kleen wrote: @@ -1224,6 +1240,15 @@ again: x86_pmu.drain_pebs(regs); } + /* + * To avoid spurious interrupts with perf stat always reset checkpointed + * counters. + * + * XXX move somewhere else.

Re: [PATCH 1/4] perf, x86: Avoid checkpointed counters causing excessive TSX aborts v4

2013-08-30 Thread Andi Kleen
On Fri, Aug 30, 2013 at 06:02:15PM +0200, Peter Zijlstra wrote: On Wed, Aug 21, 2013 at 04:47:23PM -0700, Andi Kleen wrote: @@ -1224,6 +1240,15 @@ again: x86_pmu.drain_pebs(regs); } + /* +* To avoid spurious interrupts with perf stat always reset checkpointed

[PATCH 1/4] perf, x86: Avoid checkpointed counters causing excessive TSX aborts v4

2013-08-21 Thread Andi Kleen
From: Andi Kleen With checkpointed counters there can be a situation where the counter is overflowing, aborts the transaction, is set back to a non overflowing checkpoint, causes interupt. The interrupt doesn't see the overflow because it has been checkpointed. This is then a spurious PMI,

[PATCH 1/4] perf, x86: Avoid checkpointed counters causing excessive TSX aborts v4

2013-08-21 Thread Andi Kleen
From: Andi Kleen a...@linux.intel.com With checkpointed counters there can be a situation where the counter is overflowing, aborts the transaction, is set back to a non overflowing checkpoint, causes interupt. The interrupt doesn't see the overflow because it has been checkpointed. This is then

[PATCH 1/4] perf, x86: Avoid checkpointed counters causing excessive TSX aborts v4

2013-08-14 Thread Andi Kleen
From: Andi Kleen With checkpointed counters there can be a situation where the counter is overflowing, aborts the transaction, is set back to a non overflowing checkpoint, causes interupt. The interrupt doesn't see the overflow because it has been checkpointed. This is then a spurious PMI,

[PATCH 1/4] perf, x86: Avoid checkpointed counters causing excessive TSX aborts v4

2013-08-14 Thread Andi Kleen
From: Andi Kleen a...@linux.intel.com With checkpointed counters there can be a situation where the counter is overflowing, aborts the transaction, is set back to a non overflowing checkpoint, causes interupt. The interrupt doesn't see the overflow because it has been checkpointed. This is then

Re: [PATCH 1/4] perf, x86: Avoid checkpointed counters causing excessive TSX aborts v4

2013-08-13 Thread Peter Zijlstra
On Thu, Aug 08, 2013 at 06:15:43PM -0700, Andi Kleen wrote: > +++ b/arch/x86/kernel/cpu/perf_event_intel.c > @@ -1141,6 +1146,17 @@ static void intel_pmu_enable_event(struct perf_event > *event) > int intel_pmu_save_and_restart(struct perf_event *event) > { >

Re: [PATCH 1/4] perf, x86: Avoid checkpointed counters causing excessive TSX aborts v4

2013-08-13 Thread Peter Zijlstra
On Thu, Aug 08, 2013 at 06:15:43PM -0700, Andi Kleen wrote: +++ b/arch/x86/kernel/cpu/perf_event_intel.c @@ -1141,6 +1146,17 @@ static void intel_pmu_enable_event(struct perf_event *event) int intel_pmu_save_and_restart(struct perf_event *event) { x86_perf_event_update(event); +

[PATCH 1/4] perf, x86: Avoid checkpointed counters causing excessive TSX aborts v4

2013-08-08 Thread Andi Kleen
From: Andi Kleen With checkpointed counters there can be a situation where the counter is overflowing, aborts the transaction, is set back to a non overflowing checkpoint, causes interupt. The interrupt doesn't see the overflow because it has been checkpointed. This is then a spurious PMI,

[PATCH 1/4] perf, x86: Avoid checkpointed counters causing excessive TSX aborts v4

2013-08-08 Thread Andi Kleen
From: Andi Kleen a...@linux.intel.com With checkpointed counters there can be a situation where the counter is overflowing, aborts the transaction, is set back to a non overflowing checkpoint, causes interupt. The interrupt doesn't see the overflow because it has been checkpointed. This is then