Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+10 -2
+10 -2
kernel/workqueue.c
··· 50 50 #include <linux/uaccess.h> 51 51 #include <linux/sched/isolation.h> 52 52 #include <linux/nmi.h> 53 + #include <linux/kvm_para.h> 53 54 54 55 #include "workqueue_internal.h" 55 56 ··· 5773 5772 { 5774 5773 unsigned long thresh = READ_ONCE(wq_watchdog_thresh) * HZ; 5775 5774 bool lockup_detected = false; 5775 + unsigned long now = jiffies; 5776 5776 struct worker_pool *pool; 5777 5777 int pi; 5778 5778 ··· 5788 5786 if (list_empty(&pool->worklist)) 5789 5787 continue; 5790 5788 5789 + /* 5790 + * If a virtual machine is stopped by the host it can look to 5791 + * the watchdog like a stall. 5792 + */ 5793 + kvm_check_and_clear_guest_paused(); 5794 + 5791 5795 /* get the latest of pool and touched timestamps */ 5792 5796 if (pool->cpu >= 0) 5793 5797 touched = READ_ONCE(per_cpu(wq_watchdog_touched_cpu, pool->cpu)); ··· 5807 5799 ts = touched; 5808 5800 5809 5801 /* did we stall? */ 5810 - if (time_after(jiffies, ts + thresh)) { 5802 + if (time_after(now, ts + thresh)) { 5811 5803 lockup_detected = true; 5812 5804 pr_emerg("BUG: workqueue lockup - pool"); 5813 5805 pr_cont_pool_info(pool); 5814 5806 pr_cont(" stuck for %us!\n", 5815 - jiffies_to_msecs(jiffies - pool_ts) / 1000); 5807 + jiffies_to_msecs(now - pool_ts) / 1000); 5816 5808 } 5817 5809 } 5818 5810