From: "tip-bot2 for Shrikanth Hegde" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Shrikanth Hegde <sshegde@linux.ibm.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Valentin Schneider <vschneid@redhat.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: sched/core] sched: Unify SMT active check via sched_smt_active()
Date: Wed, 20 May 2026 08:34:07 -0000 [thread overview]
Message-ID: <177926604743.711.10837985488494811458.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260515172456.542799-5-sshegde@linux.ibm.com>
The following commit has been merged into the sched/core branch of tip:
Commit-ID: acbdbab75ff4b1b87ab3c3d2b6ca86948f472189
Gitweb: https://git.kernel.org/tip/acbdbab75ff4b1b87ab3c3d2b6ca86948f472189
Author: Shrikanth Hegde <sshegde@linux.ibm.com>
AuthorDate: Fri, 15 May 2026 22:54:56 +05:30
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Tue, 19 May 2026 12:17:37 +02:00
sched: Unify SMT active check via sched_smt_active()
There is a use of sched_smt_active() and explicit use of sched_smt_present.
Remove the explicit usage for better code maintenance and readability.
Note that this differs slightly for update_idle_core. It used to call
static_branch_unlikely earlier and now it will call static_branch_likely.
Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <vschneid@redhat.com>
Link: https://patch.msgid.link/20260515172456.542799-5-sshegde@linux.ibm.com
---
kernel/sched/core_sched.c | 2 +-
kernel/sched/fair.c | 2 +-
kernel/sched/sched.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/core_sched.c b/kernel/sched/core_sched.c
index 73b6b24..43e0bde 100644
--- a/kernel/sched/core_sched.c
+++ b/kernel/sched/core_sched.c
@@ -136,7 +136,7 @@ int sched_core_share_pid(unsigned int cmd, pid_t pid, enum pid_type type,
struct pid *grp;
int err = 0;
- if (!static_branch_likely(&sched_smt_present))
+ if (!sched_smt_active())
return -ENODEV;
BUILD_BUG_ON(PR_SCHED_CORE_SCOPE_THREAD != PIDTYPE_PID);
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 14bd31b..bcaaddd 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2247,7 +2247,7 @@ numa_type numa_classify(unsigned int imbalance_pct,
static inline bool test_idle_cores(int cpu);
static inline int numa_idle_core(int idle_core, int cpu)
{
- if (!static_branch_likely(&sched_smt_present) ||
+ if (!sched_smt_active() ||
idle_core >= 0 || !test_idle_cores(cpu))
return idle_core;
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index e476623..ffe77b2 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1671,7 +1671,7 @@ extern void __update_idle_core(struct rq *rq);
static inline void update_idle_core(struct rq *rq)
{
- if (static_branch_unlikely(&sched_smt_present))
+ if (sched_smt_active())
__update_idle_core(rq);
}
prev parent reply other threads:[~2026-05-20 8:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 17:24 [PATCH v4 0/4] sched: Simplify CONFIG_SCHED_SMT ifdef usage Shrikanth Hegde
2026-05-15 17:24 ` [PATCH v4 1/4] topology: Introduce cpu_smt_mask for CONFIG_SCHED_SMT=n Shrikanth Hegde
2026-05-20 8:34 ` [tip: sched/core] " tip-bot2 for Shrikanth Hegde
2026-05-15 17:24 ` [PATCH v4 2/4] sched: Simplify ifdeffery around cpu_smt_mask Shrikanth Hegde
2026-05-20 8:34 ` [tip: sched/core] " tip-bot2 for Shrikanth Hegde
2026-05-15 17:24 ` [PATCH v4 3/4] sched/fair: Add sched_smt_active check for fastpaths Shrikanth Hegde
2026-05-19 9:25 ` Valentin Schneider
2026-05-20 8:34 ` [tip: sched/core] " tip-bot2 for Shrikanth Hegde
2026-05-15 17:24 ` [PATCH v4 4/4] sched: Unify SMT active check via sched_smt_active() Shrikanth Hegde
2026-05-20 8:34 ` tip-bot2 for Shrikanth Hegde [this message]
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=177926604743.711.10837985488494811458.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=sshegde@linux.ibm.com \
--cc=vschneid@redhat.com \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®