linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] workqueue fixes for v5.13-rc3
@ 2021-05-24 16:50 Tejun Heo
  2021-05-24 17:31 ` pr-tracker-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2021-05-24 16:50 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, Lai Jiangshan

Hello, Linus.

One commit to fix spurious workqueue stall warnings across VM suspensions.

Thanks.

The following changes since commit c3d0e3fd41b7f0f5d5d5b6022ab7e813f04ea727:

  Merge tag 'fs.idmapped.mount_setattr.v5.13-rc3' of gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux (2021-05-19 06:12:31 -1000)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-5.13-fixes

for you to fetch changes up to 940d71c6462e8151c78f28e4919aa8882ff2054e:

  wq: handle VM suspension in stall detection (2021-05-20 12:58:30 -0400)

----------------------------------------------------------------
Sergey Senozhatsky (1):
      wq: handle VM suspension in stall detection

 kernel/workqueue.c | 12 ++++++++++--
 1 file 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);
 		}
 	}
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [GIT PULL] workqueue fixes for v5.13-rc3
  2021-05-24 16:50 [GIT PULL] workqueue fixes for v5.13-rc3 Tejun Heo
@ 2021-05-24 17:31 ` pr-tracker-bot
  0 siblings, 0 replies; 2+ messages in thread
From: pr-tracker-bot @ 2021-05-24 17:31 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Linus Torvalds, linux-kernel, Lai Jiangshan

The pull request you sent on Mon, 24 May 2021 12:50:07 -0400:

> git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-5.13-fixes

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/5df7ae7bed412aa3f2e26ee8271abb24885ee557

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-24 17:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-24 16:50 [GIT PULL] workqueue fixes for v5.13-rc3 Tejun Heo
2021-05-24 17:31 ` pr-tracker-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).