lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230525040038.12346-1-qiang.zhang1211@gmail.com>
Date:   Thu, 25 May 2023 12:00:38 +0800
From:   Zqiang <qiang.zhang1211@...il.com>
To:     tj@...nel.org, jiangshanlai@...il.com, qiang.zhang1211@...il.com
Cc:     linux-kernel@...r.kernel.org
Subject: [PATCH v2] workqueue: Do not set CPU_INTENSIVE worker flags with wq_cpu_intensive_thresh_us=0

If the system start with workqueue.cpu_intensive_thresh_us=0, for running
per-cpu worker, the CPU_INTENSIVE flag will be set unconditionally in
wq_worker_tick(), this commit therefore disable set CPU_INTENSIVE and
directly return when workqueue.cpu_intensive_thresh_us=0.

Signed-off-by: Zqiang <qiang.zhang1211@...il.com>
---

[   17.359725] workqueue: process_srcu hogged CPU for >0us 4 times, consider switching to WQ_UNBOUND
[   19.752679] workqueue: gc_worker hogged CPU for >0us 4 times, consider switching to WQ_UNBOUND
[   19.796721] workqueue: gc_worker hogged CPU for >0us 8 times, consider switching to WQ_UNBOUND
[   21.992637] workqueue: wait_rcu_exp_gp hogged CPU for >0us 4 times, consider switching to WQ_UNBOUND
[   27.143632] workqueue: kfree_rcu_monitor hogged CPU for >0us 4 times, consider switching to WQ_UNBOUND
[   27.143647] workqueue: kfree_rcu_monitor hogged CPU for >0us 8 times, consider switching to WQ_UNBOUND
[   38.472708] workqueue: reg_todo hogged CPU for >0us 4 times, consider switching to WQ_UNBOUND

 kernel/workqueue.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index c4f4ca0bd2af..eaea5386859e 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1152,6 +1152,7 @@ void wq_worker_tick(struct task_struct *task)
 	 * We probably want to make this prettier in the future.
 	 */
 	if ((worker->flags & WORKER_NOT_RUNNING) || READ_ONCE(worker->sleeping) ||
+						!wq_cpu_intensive_thresh_us ||
 	    worker->task->se.sum_exec_runtime - worker->current_at <
 	    wq_cpu_intensive_thresh_us * NSEC_PER_USEC)
 		return;
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ