diff options
author | Ammar Faizi <ammarfaizi2@gnuweeb.org> | 2023-02-26 23:53:20 +0700 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2023-03-17 11:49:03 -1000 |
commit | a8ec5880bd82b834717770cba4596381ffd50545 (patch) | |
tree | a5989ca904376d25bb2ccc0123b158f3687ac629 /kernel/workqueue.c | |
parent | 2c106e156a431b9190d319f68019ebf64322bfb6 (diff) |
workqueue: Simplify a pr_warn() call in wq_select_unbound_cpu()
Use pr_warn_once() to achieve the same thing. It's simpler.
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Reviewed-by: Lai Jiangshan <jiangshanlai@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index b8b541caed48..3f1fabea000f 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1392,15 +1392,13 @@ static bool is_chained_work(struct workqueue_struct *wq) */ static int wq_select_unbound_cpu(int cpu) { - static bool printed_dbg_warning; int new_cpu; if (likely(!wq_debug_force_rr_cpu)) { if (cpumask_test_cpu(cpu, wq_unbound_cpumask)) return cpu; - } else if (!printed_dbg_warning) { - pr_warn("workqueue: round-robin CPU selection forced, expect performance impact\n"); - printed_dbg_warning = true; + } else { + pr_warn_once("workqueue: round-robin CPU selection forced, expect performance impact\n"); } if (cpumask_empty(wq_unbound_cpumask)) |