]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Mar 2014 18:17:29 +0000 (10:17 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Mar 2014 18:17:29 +0000 (10:17 -0800)
added patches:
perf-fix-hotplug-splat.patch

queue-3.4/perf-fix-hotplug-splat.patch [new file with mode: 0644]
queue-3.4/series

diff --git a/queue-3.4/perf-fix-hotplug-splat.patch b/queue-3.4/perf-fix-hotplug-splat.patch
new file mode 100644 (file)
index 0000000..aea7221
--- /dev/null
@@ -0,0 +1,66 @@
+From e3703f8cdfcf39c25c4338c3ad8e68891cca3731 Mon Sep 17 00:00:00 2001
+From: Peter Zijlstra <peterz@infradead.org>
+Date: Mon, 24 Feb 2014 12:06:12 +0100
+Subject: perf: Fix hotplug splat
+
+From: Peter Zijlstra <peterz@infradead.org>
+
+commit e3703f8cdfcf39c25c4338c3ad8e68891cca3731 upstream.
+
+Drew Richardson reported that he could make the kernel go *boom* when hotplugging
+while having perf events active.
+
+It turned out that when you have a group event, the code in
+__perf_event_exit_context() fails to remove the group siblings from
+the context.
+
+We then proceed with destroying and freeing the event, and when you
+re-plug the CPU and try and add another event to that CPU, things go
+*boom* because you've still got dead entries there.
+
+Reported-by: Drew Richardson <drew.richardson@arm.com>
+Signed-off-by: Peter Zijlstra <peterz@infradead.org>
+Cc: Will Deacon <will.deacon@arm.com>
+Link: http://lkml.kernel.org/n/tip-k6v5wundvusvcseqj1si0oz0@git.kernel.org
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/events/core.c |   12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+--- a/kernel/events/core.c
++++ b/kernel/events/core.c
+@@ -7149,14 +7149,14 @@ static void perf_pmu_rotate_stop(struct
+ static void __perf_event_exit_context(void *__info)
+ {
+       struct perf_event_context *ctx = __info;
+-      struct perf_event *event, *tmp;
++      struct perf_event *event;
+       perf_pmu_rotate_stop(ctx->pmu);
+-      list_for_each_entry_safe(event, tmp, &ctx->pinned_groups, group_entry)
+-              __perf_remove_from_context(event);
+-      list_for_each_entry_safe(event, tmp, &ctx->flexible_groups, group_entry)
++      rcu_read_lock();
++      list_for_each_entry_rcu(event, &ctx->event_list, event_entry)
+               __perf_remove_from_context(event);
++      rcu_read_unlock();
+ }
+ static void perf_event_exit_cpu_context(int cpu)
+@@ -7180,11 +7180,11 @@ static void perf_event_exit_cpu(int cpu)
+ {
+       struct swevent_htable *swhash = &per_cpu(swevent_htable, cpu);
++      perf_event_exit_cpu_context(cpu);
++
+       mutex_lock(&swhash->hlist_mutex);
+       swevent_hlist_release(swhash);
+       mutex_unlock(&swhash->hlist_mutex);
+-
+-      perf_event_exit_cpu_context(cpu);
+ }
+ #else
+ static inline void perf_event_exit_cpu(int cpu) { }
index 996204d87a7e22fbb163c45a563771ab358c3622..529977e7eb1651d04b18a9b546e803752aca2478 100644 (file)
@@ -35,3 +35,4 @@ usb-serial-option-blacklist-interface-4-for-cinterion-phs8-and-pxs8.patch
 usb-ftdi_sio-add-cressi-leonardo-pid.patch
 hwmon-max1668-fix-writing-the-minimum-temperature.patch
 workqueue-ensure-task-is-valid-across-kthread_stop.patch
+perf-fix-hotplug-splat.patch