History

Merge branch 'for-5.13-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq

Pull workqueue fix from Tejun Heo: "One commit to fix spurious workqueue stall warnings across VM suspensions" * 'for-5.13-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: wq: handle VM suspension in stall detection

Linus Torvalds committed 5 years ago

Commit 5df7ae72 parents f71d49e 940d71c1 file · +10 −2Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/workqueue.c+10−2
@@ -50,6 +50,7 @@ · 49 unmodified lines
5050 #include <linux/uaccess.h>
5151 #include <linux/sched/isolation.h>
5252 #include <linux/nmi.h>
53+#include <linux/kvm_para.h>
5354
5455 #include "workqueue_internal.h"
5556
@@ -5772,6 +5773,7 @@ static void wq_watchdog_timer_fn(struct timer_list *unused) · 5716 unmodified lines
57725773 {
57735774 unsigned long thresh = READ_ONCE(wq_watchdog_thresh) * HZ;
57745775 bool lockup_detected = false;
5776+ unsigned long now = jiffies;
57755777 struct worker_pool *pool;
57765778 int pi;
57775779
@@ -5786,6 +5788,12 @@ static void wq_watchdog_timer_fn(struct timer_list *unused) · 8 unmodified lines
57865788 if (list_empty(&pool->worklist))
57875789 continue;
57885790
5791+ /*
5792+ * If a virtual machine is stopped by the host it can look to
5793+ * the watchdog like a stall.
5794+ */
5795+ kvm_check_and_clear_guest_paused();
5796+
57895797 /* get the latest of pool and touched timestamps */
57905798 if (pool->cpu >= 0)
57915799 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) · 7 unmodified lines
57995807 ts = touched;
58005808
58015809 /* did we stall? */
5802− if (time_after(jiffies, ts + thresh)) {
5810+ if (time_after(now, ts + thresh)) {
58035811 lockup_detected = true;
58045812 pr_emerg("BUG: workqueue lockup - pool");
58055813 pr_cont_pool_info(pool);
58065814 pr_cont(" stuck for %us!\n",
5807− jiffies_to_msecs(jiffies - pool_ts) / 1000);
5815+ jiffies_to_msecs(now - pool_ts) / 1000);
58085816 }
58095817 }
58105818

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t