The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: Valentin Schneider <vschneid@redhat.com>,
	mingo@kernel.org, peterz@infradead.org,
	vincent.guittot@linaro.org, linux-kernel@vger.kernel.org
Cc: kprateek.nayak@amd.com, juri.lelli@redhat.com,
	dietmar.eggemann@arm.com, tj@kernel.org, rostedt@goodmis.org,
	tglx@kernel.org, mgorman@suse.de, bsegall@google.com,
	arighi@nvidia.com
Subject: Re: [PATCH 0/3] sched: Simplify ifdeffery around CONFIG_SCHED_SMT
Date: Tue, 12 May 2026 17:55:13 +0530	[thread overview]
Message-ID: <b4beb579-053b-4aaf-86b8-0f1c4015ef08@linux.ibm.com> (raw)
In-Reply-To: <xhsmhjyt83nbw.mognet@vschneid-thinkpadt14sgen2i.remote.csb>

Hi Valentin.

On 5/12/26 4:29 PM, Valentin Schneider wrote:
> On 06/05/26 16:30, Shrikanth Hegde wrote:
>> Plus, Major distros make CONFIG_SCHED_SMT=y for all major
>> archs and few archs unconditionally make CONFIG_SCHED_SMT=y (x86,
>> s390), So CONFIG_SCHED_SMT=n is a rare case.
>>
> 
> That leaves only a handful of #ifdefs:
> 
>    include/linux/sched/topology.h:35:2:#ifdef CONFIG_SCHED_SMT
>    kernel/sched/topology.c:1757:2:#ifdef CONFIG_SCHED_SMT
>    kernel/sched/topology.c:1802:2:#ifdef CONFIG_SCHED_SMT
>    arch/powerpc/kernel/smp.c:986:2:#ifdef CONFIG_SCHED_SMT
>    arch/powerpc/kernel/smp.c:1038:2:#ifdef CONFIG_SCHED_SMT
>    arch/powerpc/kernel/smp.c:1720:2:#ifdef CONFIG_SCHED_SMT
>    arch/powerpc/include/asm/smp.h:141:2:#ifdef CONFIG_SCHED_SMT
> 
> The topology code could deal with unconditionally building an SMT layer as
> it'll just get degenerated. The powerpc usage is mostly topology and
> cpu_smt_mask(). So if we want to push for it, we could even get rid of the
> config entirely.
> 

I think that's tricky. This is my take. Feel free to add/correct.

1 - That's policy decision making. It is only scheduler perspective.
     hardware topology mapping need to necessarily be on the same
     page. Hence we have the config today.


2 - Implementation is difficult as well.

Lets say we define it as:

#if !defined(cpu_smt_mask)
static inline const struct cpumask *cpu_smt_mask(int cpu)
{
         return topology_sibling_cpumask(cpu);
}
#endif

Then topology_sibling_cpumask could still point to actual HW siblings and SMT domain
may not degenerate as it could have more than 1 CPU. And Since powerpc for example
defined cpu_smt_mask, will have SMT domain always. That's not correct IMO.

  reply	other threads:[~2026-05-12 12:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06 11:00 [PATCH 0/3] sched: Simplify ifdeffery around CONFIG_SCHED_SMT Shrikanth Hegde
2026-05-06 11:00 ` [PATCH 1/3] topology: Introduce cpu_smt_mask for CONFIG_SCHED_SMT=n Shrikanth Hegde
2026-05-06 11:00 ` [PATCH 2/3] sched: Simplify ifdeffery around cpu_smt_mask Shrikanth Hegde
2026-05-11 12:53   ` Valentin Schneider
2026-05-11 14:37     ` Shrikanth Hegde
2026-05-11 18:46       ` Tejun Heo
2026-05-12 10:13       ` Shrikanth Hegde
2026-05-12 10:58       ` Valentin Schneider
2026-05-06 11:00 ` [PATCH 3/3] sched/fair: Add compile time check in fastpaths for CONFIG_SCHED_SMT=n Shrikanth Hegde
2026-05-12 10:59 ` [PATCH 0/3] sched: Simplify ifdeffery around CONFIG_SCHED_SMT Valentin Schneider
2026-05-12 12:25   ` Shrikanth Hegde [this message]
2026-05-12 15:32     ` Valentin Schneider

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=b4beb579-053b-4aaf-86b8-0f1c4015ef08@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=tglx@kernel.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