Skip to content

Commit a8ec588

Browse files
ammarfaizi2htejun
authored andcommitted
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>
1 parent 2c106e1 commit a8ec588

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

kernel/workqueue.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,15 +1392,13 @@ static bool is_chained_work(struct workqueue_struct *wq)
13921392
*/
13931393
static int wq_select_unbound_cpu(int cpu)
13941394
{
1395-
static bool printed_dbg_warning;
13961395
int new_cpu;
13971396

13981397
if (likely(!wq_debug_force_rr_cpu)) {
13991398
if (cpumask_test_cpu(cpu, wq_unbound_cpumask))
14001399
return cpu;
1401-
} else if (!printed_dbg_warning) {
1402-
pr_warn("workqueue: round-robin CPU selection forced, expect performance impact\n");
1403-
printed_dbg_warning = true;
1400+
} else {
1401+
pr_warn_once("workqueue: round-robin CPU selection forced, expect performance impact\n");
14041402
}
14051403

14061404
if (cpumask_empty(wq_unbound_cpumask))

0 commit comments

Comments
 (0)