From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM autolearn=no autolearn_force=no version=3.4.6 Received: from localhost.localdomain (unknown [182.253.183.169]) by gnuweeb.org (Postfix) with ESMTPSA id 3120C831C8; Sun, 26 Feb 2023 16:53:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1677430424; bh=oMEGAK6ZcuquAYnSKZpKSdMu7CUNw9o2Zlj5wN7zR4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CiLRx/f0KGjMkTA+yVX3K4FSI1KGHN0UJ6igB0kzDWV9298ntqmq/XS4zGs0LSJcQ WVx+0+z/uAxIrLRvkDZfPHYFMdogerGEyJf4KcWFxoyTmqiA1tb/LwVItXpJW+Yl6E 6aU4ufRrFLBQLcP95thn1if3wb5m2gkPmpdsAqiD9NwJp+Cnfapq2UOvKQncyjum+Q 8XD5Yo1xR0PXS3XwekP+qoh9gOrwDd/xTPs0tMpHzfX5M1a9WMPT4ND4V7vI+AUjWD e+vZGjk9qHHxkH9+/OIP1Ku3KY1ipAwftKNCBRqM+6+sKs9u8N5dQpZvitNDNj0XF3 AEh80AtFD4zNw== From: Ammar Faizi To: Tejun Heo Cc: Ammar Faizi , Lai Jiangshan , Linux Kernel Mailing List , GNU/Weeb Mailing List Subject: [PATCH v1 1/2] workqueue: Simplify a pr_warn() call in wq_select_unbound_cpu() Date: Sun, 26 Feb 2023 23:53:20 +0700 Message-Id: <20230226165321.24825-2-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230226165321.24825-1-ammarfaizi2@gnuweeb.org> References: <20230226165321.24825-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Use pr_warn_once() to achieve the same thing. It's simpler. Signed-off-by: Ammar Faizi --- kernel/workqueue.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index b8b541caed4854a4..3f1fabea000f4408 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)) -- Ammar Faizi