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: <20210203042010.799-1-zbestahu@gmail.com>
Date:   Wed,  3 Feb 2021 12:20:10 +0800
From:   Yue Hu <zbestahu@...il.com>
To:     mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
        bristot@...hat.com
Cc:     linux-kernel@...r.kernel.org, huyue2@...ong.com, zbestahu@....com
Subject: [PATCH] sched/topology: Switch to sched_debug() for conditional sched domain printk

From: Yue Hu <huyue2@...ong.com>

Currently, the macro sched_debug_enabled has same function as
sched_debug() with return false for !SCHED_DEBUG. And sched_debug()
is a wapper of variable sched_debug_enabled for SCHED_DEBUG. We
can use the sched_debug() for all cases. So, let's remove the
unnecessary marco, also use sched_debug() in sched_domain_debug()
for code consistency.

Signed-off-by: Yue Hu <huyue2@...ong.com>
---
 kernel/sched/topology.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 5d3675c..402138c 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -131,7 +131,7 @@ static void sched_domain_debug(struct sched_domain *sd, int cpu)
 {
 	int level = 0;
 
-	if (!sched_debug_enabled)
+	if (!sched_debug())
 		return;
 
 	if (!sd) {
@@ -152,7 +152,6 @@ static void sched_domain_debug(struct sched_domain *sd, int cpu)
 }
 #else /* !CONFIG_SCHED_DEBUG */
 
-# define sched_debug_enabled 0
 # define sched_domain_debug(sd, cpu) do { } while (0)
 static inline bool sched_debug(void)
 {
@@ -2113,7 +2112,7 @@ static bool topology_span_sane(struct sched_domain_topology_level *tl,
 	if (has_asym)
 		static_branch_inc_cpuslocked(&sched_asym_cpucapacity);
 
-	if (rq && sched_debug_enabled) {
+	if (rq && sched_debug()) {
 		pr_info("root domain span: %*pbl (max cpu_capacity = %lu)\n",
 			cpumask_pr_args(cpu_map), rq->rd->max_cpu_capacity);
 	}
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ