Skip to content

Commit 18c8ae8

Browse files
Zqianghtejun
authored andcommitted
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>
1 parent c8f6219 commit 18c8ae8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

kernel/workqueue.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,9 @@ void wq_worker_tick(struct task_struct *task)
11391139

11401140
pwq->stats[PWQ_STAT_CPU_TIME] += TICK_USEC;
11411141

1142+
if (!wq_cpu_intensive_thresh_us)
1143+
return;
1144+
11421145
/*
11431146
* If the current worker is concurrency managed and hogged the CPU for
11441147
* longer than wq_cpu_intensive_thresh_us, it's automatically marked

0 commit comments

Comments
 (0)