diff mbox series

[v2] powerpc/64s: introduce CONFIG_MAXSMP to test very large SMP

Message ID 20211109065131.2041720-1-npiggin@gmail.com (mailing list archive)
State Changes Requested
Headers show
Series [v2] powerpc/64s: introduce CONFIG_MAXSMP to test very large SMP | expand

Checks

Context Check Description
snowpatch_ozlabs/github-powerpc_sparse success Successfully ran 4 jobs.
snowpatch_ozlabs/github-powerpc_selftests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_ppctests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_kernel_qemu success Successfully ran 24 jobs.
snowpatch_ozlabs/github-powerpc_clang success Successfully ran 7 jobs.

Commit Message

Nicholas Piggin Nov. 9, 2021, 6:51 a.m. UTC
Similarly to x86, add MAXSMP that should help flush out problems with
vary large SMP and other values associated with very big systems.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
Since v1:
- Reduce MAXSMP NR_CPUS to 8192 if COMPILE_TEST, to reduce compile errors
  that aren't caught by existing x86 builds.

Thanks,
Nick

 arch/powerpc/Kconfig                   | 8 ++++++++
 arch/powerpc/platforms/Kconfig.cputype | 9 +++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

Comments

Christophe Leroy Nov. 9, 2021, 4:16 p.m. UTC | #1
Le 09/11/2021 à 07:51, Nicholas Piggin a écrit :
> Similarly to x86, add MAXSMP that should help flush out problems with
> vary large SMP and other values associated with very big systems.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
> Since v1:
> - Reduce MAXSMP NR_CPUS to 8192 if COMPILE_TEST, to reduce compile errors
>    that aren't caught by existing x86 builds.
> 
> Thanks,
> Nick
> 
>   arch/powerpc/Kconfig                   | 8 ++++++++
>   arch/powerpc/platforms/Kconfig.cputype | 9 +++++++--
>   2 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index b8f6185d3998..d585fcfa456f 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -64,6 +64,13 @@ config NEED_PER_CPU_EMBED_FIRST_CHUNK
>   config NEED_PER_CPU_PAGE_FIRST_CHUNK
>   	def_bool y if PPC64
>   
> +config MAXSMP
> +	bool "Enable Maximum number of SMP Processors and NUMA Nodes"
> +	depends on SMP && DEBUG_KERNEL && PPC_BOOK3S_64
> +	help
> +	  Enable maximum number of CPUS and NUMA Nodes for this architecture.
> +	  If unsure, say N.
> +
>   config NR_IRQS
>   	int "Number of virtual interrupt numbers"
>   	range 32 1048576
> @@ -666,6 +673,7 @@ config NUMA
>   
>   config NODES_SHIFT
>   	int
> +	default "10" if MAXSMP
>   	default "8" if PPC64
>   	default "4"
>   	depends on NUMA
> diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
> index a208997ade88..14c275e0ff93 100644
> --- a/arch/powerpc/platforms/Kconfig.cputype
> +++ b/arch/powerpc/platforms/Kconfig.cputype
> @@ -475,9 +475,14 @@ config SMP
>   
>   	  If you don't know what to do here, say N.
>   
> +# MAXSMP sets 8192 if COMPILE_TEST because that's what x86 has flushed out.
> +# Exceeding that will cause a lot of compile errors. Have to deal with those
> +# first.
>   config NR_CPUS
> -	int "Maximum number of CPUs (2-8192)" if SMP
> -	range 2 8192 if SMP
> +	int "Maximum number of CPUs (2-8192)" if SMP && !MAXSMP
> +	range 2 16384 if SMP
> +	default 16384 if MAXSMP && !COMPILE_TEST
> +	default 8192 if MAXSMP && COMPILE_TEST

You can do less complex. First hit becomes the default, so you can do:

	default 8192 if MAXSMP && COMPILE_TEST
	default 16384 if MAXSMP

So when everything is fixed, you just have to drop first line.

>   	default "1" if !SMP
>   	default "32" if PPC64
>   	default "4"
>
Michael Ellerman Nov. 11, 2021, 10:32 a.m. UTC | #2
Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> Le 09/11/2021 à 07:51, Nicholas Piggin a écrit :
...
>> diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
>> index a208997ade88..14c275e0ff93 100644
>> --- a/arch/powerpc/platforms/Kconfig.cputype
>> +++ b/arch/powerpc/platforms/Kconfig.cputype
>> @@ -475,9 +475,14 @@ config SMP
>>   
>>   	  If you don't know what to do here, say N.
>>   
>> +# MAXSMP sets 8192 if COMPILE_TEST because that's what x86 has flushed out.
>> +# Exceeding that will cause a lot of compile errors. Have to deal with those
>> +# first.
>>   config NR_CPUS
>> -	int "Maximum number of CPUs (2-8192)" if SMP
>> -	range 2 8192 if SMP
>> +	int "Maximum number of CPUs (2-8192)" if SMP && !MAXSMP
>> +	range 2 16384 if SMP
>> +	default 16384 if MAXSMP && !COMPILE_TEST
>> +	default 8192 if MAXSMP && COMPILE_TEST
>
> You can do less complex. First hit becomes the default, so you can do:
>
> 	default 8192 if MAXSMP && COMPILE_TEST
> 	default 16384 if MAXSMP

I did that when applying.

cheers
Michael Ellerman Nov. 23, 2021, 1:01 a.m. UTC | #3
Michael Ellerman <mpe@ellerman.id.au> writes:
> Christophe Leroy <christophe.leroy@csgroup.eu> writes:
>> Le 09/11/2021 à 07:51, Nicholas Piggin a écrit :
> ...
>>> diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
>>> index a208997ade88..14c275e0ff93 100644
>>> --- a/arch/powerpc/platforms/Kconfig.cputype
>>> +++ b/arch/powerpc/platforms/Kconfig.cputype
>>> @@ -475,9 +475,14 @@ config SMP
>>>   
>>>   	  If you don't know what to do here, say N.
>>>   
>>> +# MAXSMP sets 8192 if COMPILE_TEST because that's what x86 has flushed out.
>>> +# Exceeding that will cause a lot of compile errors. Have to deal with those
>>> +# first.
>>>   config NR_CPUS
>>> -	int "Maximum number of CPUs (2-8192)" if SMP
>>> -	range 2 8192 if SMP
>>> +	int "Maximum number of CPUs (2-8192)" if SMP && !MAXSMP
>>> +	range 2 16384 if SMP
>>> +	default 16384 if MAXSMP && !COMPILE_TEST
>>> +	default 8192 if MAXSMP && COMPILE_TEST
>>
>> You can do less complex. First hit becomes the default, so you can do:
>>
>> 	default 8192 if MAXSMP && COMPILE_TEST
>> 	default 16384 if MAXSMP
>
> I did that when applying.

But I'll have to drop it, it breaks the allyesconfig build:

  In file included from /home/michael/linux/arch/powerpc/include/asm/paravirt.h:15,
                   from /home/michael/linux/arch/powerpc/include/asm/qspinlock.h:6,
                   from /home/michael/linux/arch/powerpc/include/asm/spinlock.h:7,
                   from /home/michael/linux/include/linux/spinlock.h:93,
                   from /home/michael/linux/include/linux/mmzone.h:8,
                   from /home/michael/linux/include/linux/gfp.h:6,
                   from /home/michael/linux/include/linux/mm.h:10,
                   from /home/michael/linux/arch/powerpc/platforms/powernv/idle.c:9:
  /home/michael/linux/arch/powerpc/include/asm/cputhreads.h: In function ‘cpu_thread_mask_to_cores.constprop’:
  /home/michael/linux/arch/powerpc/include/asm/cputhreads.h:61:1: error: the frame size of 2064 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
     61 | }
        | ^
  /home/michael/linux/arch/powerpc/platforms/powernv/idle.c: In function ‘store_fastsleep_workaround_applyonce’:
  /home/michael/linux/arch/powerpc/platforms/powernv/idle.c:220:1: error: the frame size of 2080 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
    220 | }
        | ^
  cc1: all warnings being treated as errors
  make[4]: *** [/home/michael/linux/scripts/Makefile.build:287: arch/powerpc/platforms/powernv/idle.o] Error 1
  make[4]: *** Waiting for unfinished jobs....
  make[3]: *** [/home/michael/linux/scripts/Makefile.build:549: arch/powerpc/platforms/powernv] Error 2
  make[3]: *** Waiting for unfinished jobs....
  /home/michael/linux/arch/powerpc/kvm/book3s_hv_interrupts.S: Assembler messages:
  /home/michael/linux/arch/powerpc/kvm/book3s_hv_interrupts.S:66: Error: operand out of range (0x0000000000010440 is not between 0xffffffffffff8000 and 0x0000000000007ffc)
  make[3]: *** [/home/michael/linux/scripts/Makefile.build:388: arch/powerpc/kvm/book3s_hv_interrupts.o] Error 1
  make[3]: *** Waiting for unfinished jobs....
  make[2]: *** [/home/michael/linux/scripts/Makefile.build:549: arch/powerpc/platforms] Error 2
  make[2]: *** Waiting for unfinished jobs....
  make[2]: *** [/home/michael/linux/scripts/Makefile.build:549: arch/powerpc/kvm] Error 2
  make[1]: *** [/home/michael/linux/Makefile:1846: arch/powerpc] Error 2
  make[1]: *** Waiting for unfinished jobs....
  make: *** [Makefile:219: __sub-make] Error 2

cheers
Nicholas Piggin Nov. 23, 2021, 5:14 a.m. UTC | #4
Excerpts from Michael Ellerman's message of November 23, 2021 11:01 am:
> Michael Ellerman <mpe@ellerman.id.au> writes:
>> Christophe Leroy <christophe.leroy@csgroup.eu> writes:
>>> Le 09/11/2021 à 07:51, Nicholas Piggin a écrit :
>> ...
>>>> diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
>>>> index a208997ade88..14c275e0ff93 100644
>>>> --- a/arch/powerpc/platforms/Kconfig.cputype
>>>> +++ b/arch/powerpc/platforms/Kconfig.cputype
>>>> @@ -475,9 +475,14 @@ config SMP
>>>>   
>>>>   	  If you don't know what to do here, say N.
>>>>   
>>>> +# MAXSMP sets 8192 if COMPILE_TEST because that's what x86 has flushed out.
>>>> +# Exceeding that will cause a lot of compile errors. Have to deal with those
>>>> +# first.
>>>>   config NR_CPUS
>>>> -	int "Maximum number of CPUs (2-8192)" if SMP
>>>> -	range 2 8192 if SMP
>>>> +	int "Maximum number of CPUs (2-8192)" if SMP && !MAXSMP
>>>> +	range 2 16384 if SMP
>>>> +	default 16384 if MAXSMP && !COMPILE_TEST
>>>> +	default 8192 if MAXSMP && COMPILE_TEST
>>>
>>> You can do less complex. First hit becomes the default, so you can do:
>>>
>>> 	default 8192 if MAXSMP && COMPILE_TEST
>>> 	default 16384 if MAXSMP
>>
>> I did that when applying.
> 
> But I'll have to drop it, it breaks the allyesconfig build:

Ah, you still need patch 1/2 sorry I confused things by only re-sending 
this one.

https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20211105035042.1398309-1-npiggin@gmail.com/

Thanks,
Nick

> 
>   In file included from /home/michael/linux/arch/powerpc/include/asm/paravirt.h:15,
>                    from /home/michael/linux/arch/powerpc/include/asm/qspinlock.h:6,
>                    from /home/michael/linux/arch/powerpc/include/asm/spinlock.h:7,
>                    from /home/michael/linux/include/linux/spinlock.h:93,
>                    from /home/michael/linux/include/linux/mmzone.h:8,
>                    from /home/michael/linux/include/linux/gfp.h:6,
>                    from /home/michael/linux/include/linux/mm.h:10,
>                    from /home/michael/linux/arch/powerpc/platforms/powernv/idle.c:9:
>   /home/michael/linux/arch/powerpc/include/asm/cputhreads.h: In function ‘cpu_thread_mask_to_cores.constprop’:
>   /home/michael/linux/arch/powerpc/include/asm/cputhreads.h:61:1: error: the frame size of 2064 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
>      61 | }
>         | ^
>   /home/michael/linux/arch/powerpc/platforms/powernv/idle.c: In function ‘store_fastsleep_workaround_applyonce’:
>   /home/michael/linux/arch/powerpc/platforms/powernv/idle.c:220:1: error: the frame size of 2080 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
>     220 | }
>         | ^
>   cc1: all warnings being treated as errors
>   make[4]: *** [/home/michael/linux/scripts/Makefile.build:287: arch/powerpc/platforms/powernv/idle.o] Error 1
>   make[4]: *** Waiting for unfinished jobs....
>   make[3]: *** [/home/michael/linux/scripts/Makefile.build:549: arch/powerpc/platforms/powernv] Error 2
>   make[3]: *** Waiting for unfinished jobs....
>   /home/michael/linux/arch/powerpc/kvm/book3s_hv_interrupts.S: Assembler messages:
>   /home/michael/linux/arch/powerpc/kvm/book3s_hv_interrupts.S:66: Error: operand out of range (0x0000000000010440 is not between 0xffffffffffff8000 and 0x0000000000007ffc)
>   make[3]: *** [/home/michael/linux/scripts/Makefile.build:388: arch/powerpc/kvm/book3s_hv_interrupts.o] Error 1
>   make[3]: *** Waiting for unfinished jobs....
>   make[2]: *** [/home/michael/linux/scripts/Makefile.build:549: arch/powerpc/platforms] Error 2
>   make[2]: *** Waiting for unfinished jobs....
>   make[2]: *** [/home/michael/linux/scripts/Makefile.build:549: arch/powerpc/kvm] Error 2
>   make[1]: *** [/home/michael/linux/Makefile:1846: arch/powerpc] Error 2
>   make[1]: *** Waiting for unfinished jobs....
>   make: *** [Makefile:219: __sub-make] Error 2
> 
> cheers
>
Nicholas Piggin Nov. 23, 2021, 5:16 a.m. UTC | #5
Excerpts from Nicholas Piggin's message of November 23, 2021 3:14 pm:
> Excerpts from Michael Ellerman's message of November 23, 2021 11:01 am:
>> Michael Ellerman <mpe@ellerman.id.au> writes:
>>> Christophe Leroy <christophe.leroy@csgroup.eu> writes:
>>>> Le 09/11/2021 à 07:51, Nicholas Piggin a écrit :
>>> ...
>>>>> diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
>>>>> index a208997ade88..14c275e0ff93 100644
>>>>> --- a/arch/powerpc/platforms/Kconfig.cputype
>>>>> +++ b/arch/powerpc/platforms/Kconfig.cputype
>>>>> @@ -475,9 +475,14 @@ config SMP
>>>>>   
>>>>>   	  If you don't know what to do here, say N.
>>>>>   
>>>>> +# MAXSMP sets 8192 if COMPILE_TEST because that's what x86 has flushed out.
>>>>> +# Exceeding that will cause a lot of compile errors. Have to deal with those
>>>>> +# first.
>>>>>   config NR_CPUS
>>>>> -	int "Maximum number of CPUs (2-8192)" if SMP
>>>>> -	range 2 8192 if SMP
>>>>> +	int "Maximum number of CPUs (2-8192)" if SMP && !MAXSMP
>>>>> +	range 2 16384 if SMP
>>>>> +	default 16384 if MAXSMP && !COMPILE_TEST
>>>>> +	default 8192 if MAXSMP && COMPILE_TEST
>>>>
>>>> You can do less complex. First hit becomes the default, so you can do:
>>>>
>>>> 	default 8192 if MAXSMP && COMPILE_TEST
>>>> 	default 16384 if MAXSMP
>>>
>>> I did that when applying.
>> 
>> But I'll have to drop it, it breaks the allyesconfig build:
> 
> Ah, you still need patch 1/2 sorry I confused things by only re-sending 
> this one.
> 
> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20211105035042.1398309-1-npiggin@gmail.com/

Actually KVM will also be broken, I sent a patch for it but there is 
some discussion of fixing it a different way. So maybe leave out the
maxsmp patch for now (or make it depend on BROKEN?). I can re-send
maybe next merge window if the other pieces are in place.

If you could still take that ^^ patch for now would be good though.

Thanks,
Nick
diff mbox series

Patch

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index b8f6185d3998..d585fcfa456f 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -64,6 +64,13 @@  config NEED_PER_CPU_EMBED_FIRST_CHUNK
 config NEED_PER_CPU_PAGE_FIRST_CHUNK
 	def_bool y if PPC64
 
+config MAXSMP
+	bool "Enable Maximum number of SMP Processors and NUMA Nodes"
+	depends on SMP && DEBUG_KERNEL && PPC_BOOK3S_64
+	help
+	  Enable maximum number of CPUS and NUMA Nodes for this architecture.
+	  If unsure, say N.
+
 config NR_IRQS
 	int "Number of virtual interrupt numbers"
 	range 32 1048576
@@ -666,6 +673,7 @@  config NUMA
 
 config NODES_SHIFT
 	int
+	default "10" if MAXSMP
 	default "8" if PPC64
 	default "4"
 	depends on NUMA
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index a208997ade88..14c275e0ff93 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -475,9 +475,14 @@  config SMP
 
 	  If you don't know what to do here, say N.
 
+# MAXSMP sets 8192 if COMPILE_TEST because that's what x86 has flushed out.
+# Exceeding that will cause a lot of compile errors. Have to deal with those
+# first.
 config NR_CPUS
-	int "Maximum number of CPUs (2-8192)" if SMP
-	range 2 8192 if SMP
+	int "Maximum number of CPUs (2-8192)" if SMP && !MAXSMP
+	range 2 16384 if SMP
+	default 16384 if MAXSMP && !COMPILE_TEST
+	default 8192 if MAXSMP && COMPILE_TEST
 	default "1" if !SMP
 	default "32" if PPC64
 	default "4"