summaryrefslogtreecommitdiff
path: root/kernel/events
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-09-05 13:09:59 +0300
committerIngo Molnar <mingo@kernel.org>2016-09-05 13:09:59 +0300
commit2cc538412a1ca103923ec400a339a5b3833e0280 (patch)
treec141b83e1da736c3d069ed491816d0096e1b532a /kernel/events
parent36e674a05164cdbb9d4a5b1b0b279fabae6c13bd (diff)
parent58763148758057ffc447bf990321d3ea86d199a0 (diff)
downloadlinux-2cc538412a1ca103923ec400a339a5b3833e0280.tar.xz
Merge branch 'perf/urgent' into perf/core, to pick up fixed and resolve conflicts
Conflicts: kernel/events/core.c Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/events')
-rw-r--r--kernel/events/core.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 3f07e6cfc1b6..dff00c787867 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -3578,10 +3578,18 @@ static int perf_event_read(struct perf_event *event, bool group)
cpu_to_read = find_cpu_to_read(event, local_cpu);
put_cpu();
- ret = smp_call_function_single(cpu_to_read, __perf_event_read, &data, 1);
- /* The event must have been read from an online CPU: */
- WARN_ON_ONCE(ret);
- ret = ret ? : data.ret;
+ /*
+ * Purposely ignore the smp_call_function_single() return
+ * value.
+ *
+ * If event->oncpu isn't a valid CPU it means the event got
+ * scheduled out and that will have updated the event count.
+ *
+ * Therefore, either way, we'll have an up-to-date event count
+ * after this.
+ */
+ (void)smp_call_function_single(cpu_to_read, __perf_event_read, &data, 1);
+ ret = data.ret;
} else if (event->state == PERF_EVENT_STATE_INACTIVE) {
struct perf_event_context *ctx = event->ctx;
unsigned long flags;
@@ -6196,7 +6204,7 @@ static int __perf_pmu_output_stop(void *info)
{
struct perf_event *event = info;
struct pmu *pmu = event->pmu;
- struct perf_cpu_context *cpuctx = get_cpu_ptr(pmu->pmu_cpu_context);
+ struct perf_cpu_context *cpuctx = this_cpu_ptr(pmu->pmu_cpu_context);
struct remote_output ro = {
.rb = event->rb,
};