lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZV-o9ORrq7OKWOry@arm.com>
Date:   Thu, 23 Nov 2023 19:33:08 +0000
From:   Catalin Marinas <catalin.marinas@....com>
To:     "Christoph Lameter (Ampere)" <cl@...two.org>
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Anshuman.Khandual@....com, Valentin.Schneider@....com,
        Vanshidhar Konda <vanshikonda@...amperecomputing.com>,
        Jonathan Cameron <Jonathan.Cameron@...wei.com>,
        Robin Murphy <robin.murphy@....com>,
        Dave Kleikamp <dave.kleikamp@...cle.com>,
        Matteo Carlini <Matteo.Carlini@....com>
Subject: Re: [PATCH ARM64]: Introduce CONFIG_MAXSMP to allow up to 512 cpus

On Mon, Nov 20, 2023 at 05:04:35PM -0800, Christoph Lameter (Ampere) wrote:
> Index: linux/arch/arm64/Kconfig
> ===================================================================
> --- linux.orig/arch/arm64/Kconfig
> +++ linux/arch/arm64/Kconfig
> @@ -1402,10 +1402,56 @@ config SCHED_SMT
>   	  MultiThreading at a cost of slightly increased overhead in some
>   	  places. If unsure say N here.
> 
> +
> +config MAXSMP
> +	bool "Compile kernel with support for the maximum number of SMP Processors"
> +	depends on SMP && DEBUG_KERNEL
> +	select CPUMASK_OFFSTACK
> +	help
> +	  Enable maximum number of CPUS and NUMA Nodes for this architecture.
> +	  If unsure, say N.
> +
> +#
> +# The maximum number of CPUs supported:
> +#
> +# The main config value is NR_CPUS, which defaults to NR_CPUS_DEFAULT,
> +# and which can be configured interactively in the
> +# [NR_CPUS_RANGE_BEGIN ... NR_CPUS_RANGE_END] range.
> +#
> +# ( If MAXSMP is enabled we just use the highest possible value and disable
> +#   interactive configuration. )
> +#
> +
> +config NR_CPUS_RANGE_BEGIN
> +	int
> +	default NR_CPUS_RANGE_END if MAXSMP
> +	default    1 if !SMP
> +	default    2

We don't support !SMP on arm64.

> +
> +config NR_CPUS_RANGE_END
> +	int
> +	default 8192 if  SMP && CPUMASK_OFFSTACK
> +	default  512 if  SMP && !CPUMASK_OFFSTACK
> +	default    1 if !SMP
> +
> +config NR_CPUS_DEFAULT
> +	int
> +	default  512 if  MAXSMP
> +	default   64 if  SMP
> +	default    1 if !SMP
> +
>   config NR_CPUS
> -	int "Maximum number of CPUs (2-4096)"
> -	range 2 4096
> -	default "256"
> +	int "Set maximum number of CPUs" if SMP && !MAXSMP
> +	range NR_CPUS_RANGE_BEGIN NR_CPUS_RANGE_END
> +	default NR_CPUS_DEFAULT
> +	help
> +	  This allows you to specify the maximum number of CPUs which this
> +	  kernel will support.  If CPUMASK_OFFSTACK is enabled, the maximum
> +	  supported value is 8192, otherwise the maximum value is 512.  The
> +	  minimum value which makes sense is 2.
> +
> +	  This is purely to save memory: each supported CPU adds about 8KB
> +	  to the kernel image.

Is this all needed just to select CPUMASK_OFFSTACK if larger NR_CPUS?
Would something like this do:

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 7b071a00425d..697d5700bad1 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -119,6 +119,7 @@ config ARM64
 	select CLONE_BACKWARDS
 	select COMMON_CLK
 	select CPU_PM if (SUSPEND || CPU_IDLE)
+	select CPUMASK_OFFSTACK if NR_CPUS > 512
 	select CRC32
 	select DCACHE_WORD_ACCESS
 	select DYNAMIC_FTRACE if FUNCTION_TRACER

togehther with a larger NR_CPUS in defconfig?

-- 
Catalin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ