summaryrefslogtreecommitdiff
path: root/arch/x86/events/core.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2019-04-16 12:02:43 +0200
committerIngo Molnar <mingo@kernel.org>2019-04-16 12:02:43 +0200
commit496156e3647f44e2aab3e64f86b63294afca458a (patch)
treede4c35460ef0249623d45627ad40abad07b8e7cf /arch/x86/events/core.c
parentcabf5ebbabcd4ad59b6eb216876c4c2e56fd3386 (diff)
parent618d919cae2fcaadc752f27ddac8b939da8b441a (diff)
Merge branch 'linus' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/events/core.c')
-rw-r--r--arch/x86/events/core.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
index 24dab9ad4fd6..87b50f4be201 100644
--- a/arch/x86/events/core.c
+++ b/arch/x86/events/core.c
@@ -1369,8 +1369,9 @@ void x86_pmu_stop(struct perf_event *event, int flags)
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
struct hw_perf_event *hwc = &event->hw;
- if (__test_and_clear_bit(hwc->idx, cpuc->active_mask)) {
+ if (test_bit(hwc->idx, cpuc->active_mask)) {
x86_pmu.disable(event);
+ __clear_bit(hwc->idx, cpuc->active_mask);
cpuc->events[hwc->idx] = NULL;
WARN_ON_ONCE(hwc->state & PERF_HES_STOPPED);
hwc->state |= PERF_HES_STOPPED;
@@ -1463,16 +1464,8 @@ int x86_pmu_handle_irq(struct pt_regs *regs)
apic_write(APIC_LVTPC, APIC_DM_NMI);
for (idx = 0; idx < x86_pmu.num_counters; idx++) {
- if (!test_bit(idx, cpuc->active_mask)) {
- /*
- * Though we deactivated the counter some cpus
- * might still deliver spurious interrupts still
- * in flight. Catch them:
- */
- if (__test_and_clear_bit(idx, cpuc->running))
- handled++;
+ if (!test_bit(idx, cpuc->active_mask))
continue;
- }
event = cpuc->events[idx];