aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-09-12 15:37:22 -0400
committerIngo Molnar <mingo@kernel.org>2017-09-14 05:41:08 -0400
commita33d44843d4574ec05bec39527d8a87b7af2072c (patch)
tree1b894abf08ea830e70302c6e71781c80f993c15e /kernel
parent146c9d0e9dfdb62ed6afd43cc263efafbbfd1dcf (diff)
watchdog/hardlockup/perf: Simplify deferred event destroy
Now that all functionality is properly serialized against CPU hotplug, remove the extra per cpu storage which holds the disabled events for cleanup. The core makes sure that cleanup happens before new events are created. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Don Zickus <dzickus@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Chris Metcalf <cmetcalf@mellanox.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sebastian Siewior <bigeasy@linutronix.de> Cc: Ulrich Obergfell <uobergfe@redhat.com> Link: http://lkml.kernel.org/r/20170912194148.340708074@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/watchdog_hld.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/kernel/watchdog_hld.c b/kernel/watchdog_hld.c
index 509bb6b59c41..b2931154b5f2 100644
--- a/kernel/watchdog_hld.c
+++ b/kernel/watchdog_hld.c
@@ -21,7 +21,6 @@
21static DEFINE_PER_CPU(bool, hard_watchdog_warn); 21static DEFINE_PER_CPU(bool, hard_watchdog_warn);
22static DEFINE_PER_CPU(bool, watchdog_nmi_touch); 22static DEFINE_PER_CPU(bool, watchdog_nmi_touch);
23static DEFINE_PER_CPU(struct perf_event *, watchdog_ev); 23static DEFINE_PER_CPU(struct perf_event *, watchdog_ev);
24static DEFINE_PER_CPU(struct perf_event *, dead_event);
25static struct cpumask dead_events_mask; 24static struct cpumask dead_events_mask;
26 25
27static unsigned long hardlockup_allcpu_dumped; 26static unsigned long hardlockup_allcpu_dumped;
@@ -204,8 +203,6 @@ void hardlockup_detector_perf_disable(void)
204 203
205 if (event) { 204 if (event) {
206 perf_event_disable(event); 205 perf_event_disable(event);
207 this_cpu_write(watchdog_ev, NULL);
208 this_cpu_write(dead_event, event);
209 cpumask_set_cpu(smp_processor_id(), &dead_events_mask); 206 cpumask_set_cpu(smp_processor_id(), &dead_events_mask);
210 watchdog_cpus--; 207 watchdog_cpus--;
211 } 208 }
@@ -221,9 +218,9 @@ void hardlockup_detector_perf_cleanup(void)
221 int cpu; 218 int cpu;
222 219
223 for_each_cpu(cpu, &dead_events_mask) { 220 for_each_cpu(cpu, &dead_events_mask) {
224 struct perf_event *event = per_cpu(dead_event, cpu); 221 struct perf_event *event = per_cpu(watchdog_ev, cpu);
225 222
226 per_cpu(dead_event, cpu) = NULL; 223 per_cpu(watchdog_ev, cpu) = NULL;
227 perf_event_release_kernel(event); 224 perf_event_release_kernel(event);
228 } 225 }
229 cpumask_clear(&dead_events_mask); 226 cpumask_clear(&dead_events_mask);