Commit 96f7268
perf/core: Avoid removing shared pmu_context on unregister
In commit 1fd7e41 ("perf/core: Remove perf_cpu_context::unique_pmu"),
the search for another user of the pmu_cpu_context was removed, and so
we unconditionally free it during perf_pmu_unregister. This leads to
random corruption later and a BUG at mm/percpu.c:689.
v2: Check for shared pmu_contexts under the mutex.
Fixes: 1fd7e41 ("perf/core: Remove perf_cpu_context::unique_pmu")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: David Carrillo-Cisneros <davidcc@google.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: <stable@vger.kernel.org> # v4.11+
Link: http://patchwork.freedesktop.org/patch/msgid/20170512114525.17575-1-chris@chris-wilson.co.uk
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>1 parent 1cb152f commit 96f7268
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11342 | 11342 | | |
11343 | 11343 | | |
11344 | 11344 | | |
11345 | | - | |
| 11345 | + | |
| 11346 | + | |
11346 | 11347 | | |
11347 | 11348 | | |
11348 | 11349 | | |
| |||
0 commit comments