summaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorZqiang <qiang.zhang1211@gmail.com>2023-05-25 06:00:38 +0200
committerTejun Heo <tj@kernel.org>2023-05-25 22:46:53 +0200
commit18c8ae813156a6855f026de80fffb91e1a28ab3d (patch)
tree8d41793c9775f9f18ef9c6b4c542c41d3d27eaf6 /kernel/workqueue.c
parentworkqueue: Fix WARN_ON_ONCE() triggers in worker_enter_idle() (diff)
downloadlinux-18c8ae813156a6855f026de80fffb91e1a28ab3d.tar.xz
linux-18c8ae813156a6855f026de80fffb91e1a28ab3d.zip
workqueue: Disable per-cpu CPU hog detection when wq_cpu_intensive_thresh_us is 0
If workqueue.cpu_intensive_thresh_us is set to 0, the detection mechanism for CPU-hogging per-cpu work item will keep triggering spuriously: workqueue: process_srcu hogged CPU for >0us 4 times, consider switching to WQ_UNBOUND workqueue: gc_worker hogged CPU for >0us 4 times, consider switching to WQ_UNBOUND workqueue: gc_worker hogged CPU for >0us 8 times, consider switching to WQ_UNBOUND workqueue: wait_rcu_exp_gp hogged CPU for >0us 4 times, consider switching to WQ_UNBOUND workqueue: kfree_rcu_monitor hogged CPU for >0us 4 times, consider switching to WQ_UNBOUND workqueue: kfree_rcu_monitor hogged CPU for >0us 8 times, consider switching to WQ_UNBOUND workqueue: reg_todo hogged CPU for >0us 4 times, consider switching to WQ_UNBOUND This commit therefore disables the CPU-hog detection mechanism when workqueue.cpu_intensive_thresh_us is set to 0. tj: Patch description updated and the condition check on cpu_intensive_thresh_us separated into a separate if statement for readability. Signed-off-by: Zqiang <qiang.zhang1211@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 3ad6806c7161..41b8388f4284 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1139,6 +1139,9 @@ void wq_worker_tick(struct task_struct *task)
pwq->stats[PWQ_STAT_CPU_TIME] += TICK_USEC;
+ if (!wq_cpu_intensive_thresh_us)
+ return;
+
/*
* If the current worker is concurrency managed and hogged the CPU for
* longer than wq_cpu_intensive_thresh_us, it's automatically marked