Commit 68d3f1d810500e8b975bdf0b20dd83d060076b4b
Committed by
Ingo Molnar
1 parent
3aaba20f26
Exists in
master
and in
7 other branches
lockup_detector: Sync touch_*_watchdog back to old semantics
During my rewrite, the semantics of touch_nmi_watchdog and touch_softlockup_watchdog changed enough to break some drivers (mostly over preemptable regions). These are cases where long delays on one CPU (due to print_delay for example) can cause long delays on other CPUs - so we must 'touch' the nmi_watchdog flag of those other CPUs as well. This change brings those touch_*_watchdog() functions back in line with to how they used to work. Signed-off-by: Don Zickus <dzickus@redhat.com> Acked-by: Cyrill Gorcunov <gorcunov@openvz.org> Cc: peterz@infradead.org Cc: fweisbec@gmail.com LKML-Reference: <1283310009-22168-2-git-send-email-dzickus@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Showing 1 changed file with 12 additions and 5 deletions Side-by-side Diff
kernel/watchdog.c
... | ... | @@ -122,7 +122,7 @@ |
122 | 122 | |
123 | 123 | void touch_softlockup_watchdog(void) |
124 | 124 | { |
125 | - __get_cpu_var(watchdog_touch_ts) = 0; | |
125 | + __raw_get_cpu_var(watchdog_touch_ts) = 0; | |
126 | 126 | } |
127 | 127 | EXPORT_SYMBOL(touch_softlockup_watchdog); |
128 | 128 | |
... | ... | @@ -142,7 +142,14 @@ |
142 | 142 | #ifdef CONFIG_HARDLOCKUP_DETECTOR |
143 | 143 | void touch_nmi_watchdog(void) |
144 | 144 | { |
145 | - __get_cpu_var(watchdog_nmi_touch) = true; | |
145 | + if (watchdog_enabled) { | |
146 | + unsigned cpu; | |
147 | + | |
148 | + for_each_present_cpu(cpu) { | |
149 | + if (per_cpu(watchdog_nmi_touch, cpu) != true) | |
150 | + per_cpu(watchdog_nmi_touch, cpu) = true; | |
151 | + } | |
152 | + } | |
146 | 153 | touch_softlockup_watchdog(); |
147 | 154 | } |
148 | 155 | EXPORT_SYMBOL(touch_nmi_watchdog); |
... | ... | @@ -433,6 +440,9 @@ |
433 | 440 | wake_up_process(p); |
434 | 441 | } |
435 | 442 | |
443 | + /* if any cpu succeeds, watchdog is considered enabled for the system */ | |
444 | + watchdog_enabled = 1; | |
445 | + | |
436 | 446 | return 0; |
437 | 447 | } |
438 | 448 | |
... | ... | @@ -455,9 +465,6 @@ |
455 | 465 | per_cpu(softlockup_watchdog, cpu) = NULL; |
456 | 466 | kthread_stop(p); |
457 | 467 | } |
458 | - | |
459 | - /* if any cpu succeeds, watchdog is considered enabled for the system */ | |
460 | - watchdog_enabled = 1; | |
461 | 468 | } |
462 | 469 | |
463 | 470 | static void watchdog_enable_all_cpus(void) |