mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
workqueue: avoid hard lockups in show_workqueue_state()
commit 62635ea8c1
upstream.
show_workqueue_state() can print out a lot of messages while being in
atomic context, e.g. sysrq-t -> show_workqueue_state(). If the console
device is slow it may end up triggering NMI hard lockup watchdog.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
edd0a403a1
commit
a6d5930ccf
1 changed files with 13 additions and 0 deletions
|
@ -48,6 +48,7 @@
|
|||
#include <linux/nodemask.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/nmi.h>
|
||||
|
||||
#include "workqueue_internal.h"
|
||||
|
||||
|
@ -4479,6 +4480,12 @@ void show_workqueue_state(void)
|
|||
if (pwq->nr_active || !list_empty(&pwq->delayed_works))
|
||||
show_pwq(pwq);
|
||||
spin_unlock_irqrestore(&pwq->pool->lock, flags);
|
||||
/*
|
||||
* We could be printing a lot from atomic context, e.g.
|
||||
* sysrq-t -> show_workqueue_state(). Avoid triggering
|
||||
* hard lockup.
|
||||
*/
|
||||
touch_nmi_watchdog();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4506,6 +4513,12 @@ void show_workqueue_state(void)
|
|||
pr_cont("\n");
|
||||
next_pool:
|
||||
spin_unlock_irqrestore(&pool->lock, flags);
|
||||
/*
|
||||
* We could be printing a lot from atomic context, e.g.
|
||||
* sysrq-t -> show_workqueue_state(). Avoid triggering
|
||||
* hard lockup.
|
||||
*/
|
||||
touch_nmi_watchdog();
|
||||
}
|
||||
|
||||
rcu_read_unlock_sched();
|
||||
|
|
Loading…
Reference in a new issue