.. | .. |
---|
24 | 24 | static DEFINE_PER_CPU(bool, watchdog_nmi_touch); |
---|
25 | 25 | static DEFINE_PER_CPU(struct perf_event *, watchdog_ev); |
---|
26 | 26 | static DEFINE_PER_CPU(struct perf_event *, dead_event); |
---|
27 | | -static DEFINE_RAW_SPINLOCK(watchdog_output_lock); |
---|
28 | | - |
---|
29 | 27 | static struct cpumask dead_events_mask; |
---|
30 | 28 | |
---|
31 | 29 | static unsigned long hardlockup_allcpu_dumped; |
---|
.. | .. |
---|
116 | 114 | /* Ensure the watchdog never gets throttled */ |
---|
117 | 115 | event->hw.interrupts = 0; |
---|
118 | 116 | |
---|
| 117 | + if (!watchdog_check_timestamp()) |
---|
| 118 | + return; |
---|
| 119 | + |
---|
119 | 120 | if (__this_cpu_read(watchdog_nmi_touch) == true) { |
---|
120 | 121 | __this_cpu_write(watchdog_nmi_touch, false); |
---|
121 | 122 | return; |
---|
122 | 123 | } |
---|
123 | | - |
---|
124 | | - if (!watchdog_check_timestamp()) |
---|
125 | | - return; |
---|
126 | 124 | |
---|
127 | 125 | /* check for a hardlockup |
---|
128 | 126 | * This is done by making sure our timer interrupt |
---|
.. | .. |
---|
136 | 134 | /* only print hardlockups once */ |
---|
137 | 135 | if (__this_cpu_read(hard_watchdog_warn) == true) |
---|
138 | 136 | return; |
---|
139 | | - /* |
---|
140 | | - * If early-printk is enabled then make sure we do not |
---|
141 | | - * lock up in printk() and kill console logging: |
---|
142 | | - */ |
---|
143 | | - printk_kill(); |
---|
144 | 137 | |
---|
145 | | - raw_spin_lock(&watchdog_output_lock); |
---|
146 | | - |
---|
147 | | - pr_emerg("Watchdog detected hard LOCKUP on cpu %d", this_cpu); |
---|
| 138 | + pr_emerg("Watchdog detected hard LOCKUP on cpu %d\n", |
---|
| 139 | + this_cpu); |
---|
148 | 140 | print_modules(); |
---|
149 | 141 | print_irqtrace_events(current); |
---|
150 | 142 | if (regs) |
---|
.. | .. |
---|
160 | 152 | !test_and_set_bit(0, &hardlockup_allcpu_dumped)) |
---|
161 | 153 | trigger_allbutself_cpu_backtrace(); |
---|
162 | 154 | |
---|
163 | | - raw_spin_unlock(&watchdog_output_lock); |
---|
164 | 155 | if (hardlockup_panic) |
---|
165 | 156 | nmi_panic(regs, "Hard LOCKUP"); |
---|
166 | 157 | |
---|