From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: K Prateek Nayak <kprateek.nayak@amd.com>,
mingo@kernel.org, peterz@infradead.org,
vincent.guittot@linaro.org, linux-kernel@vger.kernel.org
Cc: juri.lelli@redhat.com, vschneid@redhat.com,
dietmar.eggemann@arm.com, tj@kernel.org, rostedt@goodmis.org,
mgorman@suse.de, bsegall@google.com, arighi@nvidia.com
Subject: Re: [PATCH v2 3/3] sched/fair: Add compile time check in fastpaths for CONFIG_SCHED_SMT=n
Date: Wed, 13 May 2026 12:09:58 +0530 [thread overview]
Message-ID: <0b3d8b79-6743-4f35-abc8-da4f2a6a2d80@linux.ibm.com> (raw)
In-Reply-To: <d77b9f47-9017-402b-9814-bcd4b08feb51@amd.com>
Hi Prateek.
> ... I think the if() above can simply check for sched_smt_active()
> before calling is_core_idle() like:
>
> if (sched_smt_active() &&
> !(env->sd->flags & SD_SHARE_CPUCAPACITY) &&
> !is_core_idle(cpu)) {
> ...
> }
>
> That way, we ensure we don't call is_core_idle() and the cpumask_and()
> unnecessarily on topologies that don't have SMT domain similar to how
> sched_use_asym_prio() guards the call to is_core_idle().
>
> Thoughts?
>
In addition, Do you think it makes sense to consolidate use of
sched_smt_present always using sched_smt_active() ?
static __always_inline bool sched_smt_active(void)
{
return static_branch_likely(&sched_smt_present);
}
kernel/sched/core_sched.c: if (!static_branch_likely(&sched_smt_present))
kernel/sched/fair.c: if (!static_branch_likely(&sched_smt_present) ||
kernel/sched/sched.h: if (static_branch_unlikely(&sched_smt_present))
The last being differing with unlikely in update_idle_core.
Does it make sense to call sched_smt_active there as well?
next prev parent reply other threads:[~2026-05-13 6:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 15:21 [PATCH v2 0/3] sched: Simplify ifdeffery around CONFIG_SCHED_SMT Shrikanth Hegde
2026-05-12 15:21 ` [PATCH v2 1/3] topology: Introduce cpu_smt_mask for CONFIG_SCHED_SMT=n Shrikanth Hegde
2026-05-12 16:56 ` Phil Auld
2026-05-12 15:21 ` [PATCH v2 2/3] sched: Simplify ifdeffery around cpu_smt_mask Shrikanth Hegde
2026-05-12 16:57 ` Phil Auld
2026-05-12 15:21 ` [PATCH v2 3/3] sched/fair: Add compile time check in fastpaths for CONFIG_SCHED_SMT=n Shrikanth Hegde
2026-05-12 16:59 ` Phil Auld
2026-05-13 4:15 ` Shrikanth Hegde
2026-05-13 11:53 ` Phil Auld
2026-05-13 6:07 ` K Prateek Nayak
2026-05-13 6:16 ` Shrikanth Hegde
2026-05-13 6:39 ` Shrikanth Hegde [this message]
2026-05-13 6:57 ` K Prateek Nayak
2026-05-12 17:48 ` [PATCH v2 0/3] sched: Simplify ifdeffery around CONFIG_SCHED_SMT Valentin Schneider
2026-05-13 6:20 ` K Prateek Nayak
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=0b3d8b79-6743-4f35-abc8-da4f2a6a2d80@linux.ibm.com \
--to=sshegde@linux.ibm.com \
--cc=arighi@nvidia.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tj@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.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