* [PATCH] perf,x86: P4 PMU -- update nmi irq statistics and unmask lvt entry properly
@ 2010-08-05 15:09 Cyrill Gorcunov
2010-08-07 21:48 ` Cyrill Gorcunov
2010-08-10 7:09 ` [tip:perf/urgent] perf, x86: " tip-bot for Cyrill Gorcunov
0 siblings, 2 replies; 3+ messages in thread
From: Cyrill Gorcunov @ 2010-08-05 15:09 UTC (permalink / raw)
To: Ingo Molnar
Cc: LKML, Lin Ming, Stephane Eranian, Peter Zijlstra, Frederic Weisbecker
In case if last active performance counter is not overflowed at
moment of NMI being triggered by another counter, the irq statistics
may miss an update stage. As a more serious consequence -- apic quirk
may not be triggered so apic lvt entry stay masked.
Tested-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: Lin Ming <ming.m.lin@intel.com>
CC: Stephane Eranian <eranian@google.com>
CC: Peter Zijlstra <a.p.zijlstra@chello.nl>
CC: Ingo Molnar <mingo@elte.hu>
CC: Frederic Weisbecker <fweisbec@gmail.com>
---
arch/x86/kernel/cpu/perf_event_p4.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
Index: linux-2.6.git/arch/x86/kernel/cpu/perf_event_p4.c
=====================================================================
--- linux-2.6.git.orig/arch/x86/kernel/cpu/perf_event_p4.c
+++ linux-2.6.git/arch/x86/kernel/cpu/perf_event_p4.c
@@ -656,6 +656,7 @@ static int p4_pmu_handle_irq(struct pt_r
cpuc = &__get_cpu_var(cpu_hw_events);
for (idx = 0; idx < x86_pmu.num_counters; idx++) {
+ int overflow;
if (!test_bit(idx, cpuc->active_mask))
continue;
@@ -666,12 +667,14 @@ static int p4_pmu_handle_irq(struct pt_r
WARN_ON_ONCE(hwc->idx != idx);
/* it might be unflagged overflow */
- handled = p4_pmu_clear_cccr_ovf(hwc);
+ overflow = p4_pmu_clear_cccr_ovf(hwc);
val = x86_perf_event_update(event);
- if (!handled && (val & (1ULL << (x86_pmu.cntval_bits - 1))))
+ if (!overflow && (val & (1ULL << (x86_pmu.cntval_bits - 1))))
continue;
+ handled += overflow;
+
/* event overflow for sure */
data.period = event->hw.last_period;
@@ -687,7 +690,7 @@ static int p4_pmu_handle_irq(struct pt_r
inc_irq_stat(apic_perf_irqs);
}
- return handled;
+ return handled > 0;
}
/*
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] perf,x86: P4 PMU -- update nmi irq statistics and unmask lvt entry properly
2010-08-05 15:09 [PATCH] perf,x86: P4 PMU -- update nmi irq statistics and unmask lvt entry properly Cyrill Gorcunov
@ 2010-08-07 21:48 ` Cyrill Gorcunov
2010-08-10 7:09 ` [tip:perf/urgent] perf, x86: " tip-bot for Cyrill Gorcunov
1 sibling, 0 replies; 3+ messages in thread
From: Cyrill Gorcunov @ 2010-08-07 21:48 UTC (permalink / raw)
To: Ingo Molnar
Cc: LKML, Lin Ming, Stephane Eranian, Peter Zijlstra,
Frederic Weisbecker, H. Peter Anvin
On Thu, Aug 05, 2010 at 07:09:17PM +0400, Cyrill Gorcunov wrote:
> In case if last active performance counter is not overflowed at
> moment of NMI being triggered by another counter, the irq statistics
> may miss an update stage. As a more serious consequence -- apic quirk
> may not be triggered so apic lvt entry stay masked.
>
> Tested-by: Lin Ming <ming.m.lin@intel.com>
> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
> CC: Lin Ming <ming.m.lin@intel.com>
> CC: Stephane Eranian <eranian@google.com>
> CC: Peter Zijlstra <a.p.zijlstra@chello.nl>
> CC: Ingo Molnar <mingo@elte.hu>
> CC: Frederic Weisbecker <fweisbec@gmail.com>
> ---
Ping? Frederic, perhaps you'll pick it up?
-- Cyrill
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip:perf/urgent] perf, x86: P4 PMU -- update nmi irq statistics and unmask lvt entry properly
2010-08-05 15:09 [PATCH] perf,x86: P4 PMU -- update nmi irq statistics and unmask lvt entry properly Cyrill Gorcunov
2010-08-07 21:48 ` Cyrill Gorcunov
@ 2010-08-10 7:09 ` tip-bot for Cyrill Gorcunov
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Cyrill Gorcunov @ 2010-08-10 7:09 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, eranian, hpa, mingo, gorcunov, a.p.zijlstra,
fweisbec, ming.m.lin, tglx, mingo
Commit-ID: 1c250d709fdc8aa5bf42d90be99428a01a256a55
Gitweb: http://git.kernel.org/tip/1c250d709fdc8aa5bf42d90be99428a01a256a55
Author: Cyrill Gorcunov <gorcunov@openvz.org>
AuthorDate: Thu, 5 Aug 2010 19:09:17 +0400
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Sun, 8 Aug 2010 22:53:50 +0200
perf, x86: P4 PMU -- update nmi irq statistics and unmask lvt entry properly
In case if last active performance counter is not overflowed at
moment of NMI being triggered by another counter, the irq
statistics may miss an update stage. As a more serious
consequence -- apic quirk may not be triggered so apic lvt entry
stay masked.
Tested-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20100805150917.GA6311@lenovo>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/cpu/perf_event_p4.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c
index 107711b..febb12c 100644
--- a/arch/x86/kernel/cpu/perf_event_p4.c
+++ b/arch/x86/kernel/cpu/perf_event_p4.c
@@ -656,6 +656,7 @@ static int p4_pmu_handle_irq(struct pt_regs *regs)
cpuc = &__get_cpu_var(cpu_hw_events);
for (idx = 0; idx < x86_pmu.num_counters; idx++) {
+ int overflow;
if (!test_bit(idx, cpuc->active_mask))
continue;
@@ -666,12 +667,14 @@ static int p4_pmu_handle_irq(struct pt_regs *regs)
WARN_ON_ONCE(hwc->idx != idx);
/* it might be unflagged overflow */
- handled = p4_pmu_clear_cccr_ovf(hwc);
+ overflow = p4_pmu_clear_cccr_ovf(hwc);
val = x86_perf_event_update(event);
- if (!handled && (val & (1ULL << (x86_pmu.cntval_bits - 1))))
+ if (!overflow && (val & (1ULL << (x86_pmu.cntval_bits - 1))))
continue;
+ handled += overflow;
+
/* event overflow for sure */
data.period = event->hw.last_period;
@@ -687,7 +690,7 @@ static int p4_pmu_handle_irq(struct pt_regs *regs)
inc_irq_stat(apic_perf_irqs);
}
- return handled;
+ return handled > 0;
}
/*
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-08-10 7:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-05 15:09 [PATCH] perf,x86: P4 PMU -- update nmi irq statistics and unmask lvt entry properly Cyrill Gorcunov
2010-08-07 21:48 ` Cyrill Gorcunov
2010-08-10 7:09 ` [tip:perf/urgent] perf, x86: " tip-bot for Cyrill Gorcunov
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).