summaryrefslogtreecommitdiff
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2021-07-01 07:32:37 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2021-07-01 07:32:37 +0530
commitc503c193db7d7ccc0c58b1ef694eaef331318149 (patch)
tree44d3215196f385e88fa5da6affc58649c90e0ea9 /kernel/workqueue.c
parent9821a195d4e263801884b105554e801642c59f2a (diff)
parent1eb5dde674f57b1a1918dab33f09e35cdd64eb07 (diff)
downloadlinux-c503c193db7d7ccc0c58b1ef694eaef331318149.tar.gz
linux-c503c193db7d7ccc0c58b1ef694eaef331318149.tar.bz2
linux-c503c193db7d7ccc0c58b1ef694eaef331318149.zip
Merge branch 'cpufreq/cppc-fie' into cpufreq/arm/linux-next
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index b19d759e55a5..50142fc08902 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -50,6 +50,7 @@
#include <linux/uaccess.h>
#include <linux/sched/isolation.h>
#include <linux/nmi.h>
+#include <linux/kvm_para.h>
#include "workqueue_internal.h"
@@ -5772,6 +5773,7 @@ static void wq_watchdog_timer_fn(struct timer_list *unused)
{
unsigned long thresh = READ_ONCE(wq_watchdog_thresh) * HZ;
bool lockup_detected = false;
+ unsigned long now = jiffies;
struct worker_pool *pool;
int pi;
@@ -5786,6 +5788,12 @@ static void wq_watchdog_timer_fn(struct timer_list *unused)
if (list_empty(&pool->worklist))
continue;
+ /*
+ * If a virtual machine is stopped by the host it can look to
+ * the watchdog like a stall.
+ */
+ kvm_check_and_clear_guest_paused();
+
/* get the latest of pool and touched timestamps */
if (pool->cpu >= 0)
touched = READ_ONCE(per_cpu(wq_watchdog_touched_cpu, pool->cpu));
@@ -5799,12 +5807,12 @@ static void wq_watchdog_timer_fn(struct timer_list *unused)
ts = touched;
/* did we stall? */
- if (time_after(jiffies, ts + thresh)) {
+ if (time_after(now, ts + thresh)) {
lockup_detected = true;
pr_emerg("BUG: workqueue lockup - pool");
pr_cont_pool_info(pool);
pr_cont(" stuck for %us!\n",
- jiffies_to_msecs(jiffies - pool_ts) / 1000);
+ jiffies_to_msecs(now - pool_ts) / 1000);
}
}