Subject: Re: [PATCH v7 4/8] powerpc/smp: Introduce CONFIG_SCHED_MC to guard MC scheduling bits

From: Peter Zijlstra <[email-masked]>
Date: Mon, 1 Sep 2025 10:35:07 +0200

On Thu, Aug 28, 2025 at 08:13:51PM +0530, Shrikanth Hegde wrote:

> > --- a/arch/powerpc/Kconfig
> > +++ b/arch/powerpc/Kconfig
> > @@ -170,6 +170,9 @@ config PPC
> >   	select ARCH_STACKWALK
> >   	select ARCH_SUPPORTS_ATOMIC_RMW
> >   	select ARCH_SUPPORTS_DEBUG_PAGEALLOC	if PPC_BOOK3S || PPC_8xx
> > +	select ARCH_SUPPORTS_SCHED_SMT		if PPC64 && SMP
> > +	select ARCH_SUPPORTS_SCHED_MC		if PPC64 && SMP
> > +	select SCHED_MC				if ARCH_SUPPORTS_SCHED_MC
> 
> Wondering if this SCHED_MC is necessary here? shouldn't it be set by arch/Kconfig?

Ah, so without this SCHED_MC becomes a user selectable option, with this
it is an always on option (for ppc64) -- no user prompt.

That is, this is the only way I found to have similar semantics to this:

> > -config SCHED_MC
> > -	def_bool y
> > -	depends on PPC64 && SMP
> > -

Which is also not a user selectable option.

> nit: Also, can we have so they are still sorted?
> 	select ARCH_SUPPORTS_SCHED_MC		if PPC64 && SMP
> 	select ARCH_SUPPORTS_SCHED_SMT		if PPC64 && SMP

Sure, let me flip them. I need to prod that that patch anyway, built
robot still ain'ted happy.

> > --- a/arch/s390/Kconfig
> > +++ b/arch/s390/Kconfig
> > @@ -547,15 +547,11 @@ config NODES_SHIFT
> >   	depends on NUMA
> >   	default "1"
> > -config SCHED_SMT
> > -	def_bool n
> > -
> > -config SCHED_MC
> > -	def_bool n
> > -
> >   config SCHED_TOPOLOGY
> >   	def_bool y
> >   	prompt "Topology scheduler support"
> > +	select ARCH_SUPPORTS_SCHED_SMT
> > +	select ARCH_SUPPORTS_SCHED_MC
> >   	select SCHED_SMT
> >   	select SCHED_MC
> Same here. Above two are needed?

Same issue; previously neither were user selectable symbols. By only
selecting the ARCH_SUPPORTS_$FOO variants, the $FOO options become user
selectable. By then explicitly selecting $FOO as well, that user option
is taken away again.

> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -330,6 +330,10 @@ config X86
> >   	imply IMA_SECURE_AND_OR_TRUSTED_BOOT    if EFI
> >   	select HAVE_DYNAMIC_FTRACE_NO_PATCHABLE
> >   	select ARCH_SUPPORTS_PT_RECLAIM		if X86_64
> > +	select ARCH_SUPPORTS_SCHED_SMT		if SMP
> > +	select SCHED_SMT			if SMP
> Is this SCHED_SMT needed here?

Same again...

> > +	select ARCH_SUPPORTS_SCHED_CLUSTER	if SMP
> > +	select ARCH_SUPPORTS_SCHED_MC		if SMP
> >   config INSTRUCTION_DECODER
> >   	def_bool y
> > @@ -1036,29 +1040,6 @@ config NR_CPUS
> >   	  This is purely to save memory: each supported CPU adds about 8KB
> >   	  to the kernel image.
> > -config SCHED_CLUSTER
> > -	bool "Cluster scheduler support"
> > -	depends on SMP
> > -	default y
> > -	help
> > -	  Cluster scheduler support improves the CPU scheduler's decision
> > -	  making when dealing with machines that have clusters of CPUs.
> > -	  Cluster usually means a couple of CPUs which are placed closely
> > -	  by sharing mid-level caches, last-level cache tags or internal
> > -	  busses.
> > -
> > -config SCHED_SMT
> > -	def_bool y if SMP
> > -
> > -config SCHED_MC
> > -	def_bool y
> > -	prompt "Multi-core scheduler support"
> > -	depends on SMP
> > -	help
> > -	  Multi-core scheduler support improves the CPU scheduler's decision
> > -	  making when dealing with multi-core CPU chips at a cost of slightly
> > -	  increased overhead in some places. If unsure say N here.

See how SCHED_SMT is not a user option for x86.