Skip to content

Commit 3a51449

Browse files
pmladekKAGA-KOKO
authored andcommitted
watchdog/softlockup: Remove obsolete check of last reported task
commit 9cf5773 ("watchdog/softlockup: Replace "watchdog/%u" threads with cpu_stop_work") ensures that the watchdog is reliably touched during a task switch. As a result the check for an unnoticed task switch is not longer needed. Remove the relevant code, which effectively reverts commit b1a8de1 ("softlockup: make detector be aware of task switch of processes hogging cpu") Signed-off-by: Petr Mladek <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Peter Ziljstra <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d129479 commit 3a51449

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

kernel/watchdog.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ static DEFINE_PER_CPU(struct hrtimer, watchdog_hrtimer);
173173
static DEFINE_PER_CPU(bool, softlockup_touch_sync);
174174
static DEFINE_PER_CPU(bool, soft_watchdog_warn);
175175
static DEFINE_PER_CPU(unsigned long, hrtimer_interrupts);
176-
static DEFINE_PER_CPU(struct task_struct *, softlockup_task_ptr_saved);
177176
static DEFINE_PER_CPU(unsigned long, hrtimer_interrupts_saved);
178177
static unsigned long soft_lockup_nmi_warn;
179178

@@ -413,22 +412,8 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
413412
return HRTIMER_RESTART;
414413

415414
/* only warn once */
416-
if (__this_cpu_read(soft_watchdog_warn) == true) {
417-
/*
418-
* When multiple processes are causing softlockups the
419-
* softlockup detector only warns on the first one
420-
* because the code relies on a full quiet cycle to
421-
* re-arm. The second process prevents the quiet cycle
422-
* and never gets reported. Use task pointers to detect
423-
* this.
424-
*/
425-
if (__this_cpu_read(softlockup_task_ptr_saved) !=
426-
current) {
427-
__this_cpu_write(soft_watchdog_warn, false);
428-
__touch_watchdog();
429-
}
415+
if (__this_cpu_read(soft_watchdog_warn) == true)
430416
return HRTIMER_RESTART;
431-
}
432417

433418
if (softlockup_all_cpu_backtrace) {
434419
/* Prevent multiple soft-lockup reports if one cpu is already
@@ -444,7 +429,6 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
444429
pr_emerg("BUG: soft lockup - CPU#%d stuck for %us! [%s:%d]\n",
445430
smp_processor_id(), duration,
446431
current->comm, task_pid_nr(current));
447-
__this_cpu_write(softlockup_task_ptr_saved, current);
448432
print_modules();
449433
print_irqtrace_events(current);
450434
if (regs)

0 commit comments

Comments
 (0)