linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yue Hu <zbestahu@gmail.com>
To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	bristot@redhat.com
Cc: linux-kernel@vger.kernel.org, huyue2@yulong.com, zbestahu@163.com
Subject: [PATCH] sched/topology: Switch to sched_debug() for conditional sched domain printk
Date: Wed,  3 Feb 2021 12:20:10 +0800	[thread overview]
Message-ID: <20210203042010.799-1-zbestahu@gmail.com> (raw)

From: Yue Hu <huyue2@yulong.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@yulong.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


             reply	other threads:[~2021-02-03  4:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03  4:20 Yue Hu [this message]
2021-02-03  9:52 ` [PATCH] sched/topology: Switch to sched_debug() for conditional sched domain printk Srikar Dronamraju
2021-02-03 10:10   ` Yue Hu
2021-02-03 10:59     ` Srikar Dronamraju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210203042010.799-1-zbestahu@gmail.com \
    --to=zbestahu@gmail.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=huyue2@yulong.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=zbestahu@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).