diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/watchdog_hld.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/watchdog_hld.c b/kernel/watchdog_hld.c index 71a62ceacdc8..a7f137c1933a 100644 --- a/kernel/watchdog_hld.c +++ b/kernel/watchdog_hld.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | static DEFINE_PER_CPU(bool, hard_watchdog_warn); | 21 | static DEFINE_PER_CPU(bool, hard_watchdog_warn); |
| 22 | static DEFINE_PER_CPU(bool, watchdog_nmi_touch); | 22 | static DEFINE_PER_CPU(bool, watchdog_nmi_touch); |
| 23 | static DEFINE_PER_CPU(struct perf_event *, watchdog_ev); | 23 | static DEFINE_PER_CPU(struct perf_event *, watchdog_ev); |
| 24 | static DEFINE_PER_CPU(struct perf_event *, dead_event); | ||
| 24 | static struct cpumask dead_events_mask; | 25 | static struct cpumask dead_events_mask; |
| 25 | 26 | ||
| 26 | static unsigned long hardlockup_allcpu_dumped; | 27 | static unsigned long hardlockup_allcpu_dumped; |
| @@ -203,6 +204,8 @@ void hardlockup_detector_perf_disable(void) | |||
| 203 | 204 | ||
| 204 | if (event) { | 205 | if (event) { |
| 205 | perf_event_disable(event); | 206 | perf_event_disable(event); |
| 207 | this_cpu_write(watchdog_ev, NULL); | ||
| 208 | this_cpu_write(dead_event, event); | ||
| 206 | cpumask_set_cpu(smp_processor_id(), &dead_events_mask); | 209 | cpumask_set_cpu(smp_processor_id(), &dead_events_mask); |
| 207 | watchdog_cpus--; | 210 | watchdog_cpus--; |
| 208 | } | 211 | } |
| @@ -218,7 +221,7 @@ void hardlockup_detector_perf_cleanup(void) | |||
| 218 | int cpu; | 221 | int cpu; |
| 219 | 222 | ||
| 220 | for_each_cpu(cpu, &dead_events_mask) { | 223 | for_each_cpu(cpu, &dead_events_mask) { |
| 221 | struct perf_event *event = per_cpu(watchdog_ev, cpu); | 224 | struct perf_event *event = per_cpu(dead_event, cpu); |
| 222 | 225 | ||
| 223 | /* | 226 | /* |
| 224 | * Required because for_each_cpu() reports unconditionally | 227 | * Required because for_each_cpu() reports unconditionally |
| @@ -226,7 +229,7 @@ void hardlockup_detector_perf_cleanup(void) | |||
| 226 | */ | 229 | */ |
| 227 | if (event) | 230 | if (event) |
| 228 | perf_event_release_kernel(event); | 231 | perf_event_release_kernel(event); |
| 229 | per_cpu(watchdog_ev, cpu) = NULL; | 232 | per_cpu(dead_event, cpu) = NULL; |
| 230 | } | 233 | } |
| 231 | cpumask_clear(&dead_events_mask); | 234 | cpumask_clear(&dead_events_mask); |
| 232 | } | 235 | } |
