From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4DADFC624B4 for ; Thu, 23 Nov 2023 19:33:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2zcTpgnlXx/qwFTIG0wFxnMw/SDOX13esSkLlgLkZTc=; b=cYBPP1NPGyBuC5 s8571ApVR0H7PupfdPPuyRhJ4xkj0kdZsD9sFDp02j3hAjvxkmRm8Xj6iVjvVEs9adQpjfxlcwbzW RRL8anDxmN04X/nAKgzH9ZxFV2yFhLZBgU/wtIOU8/SUbVTVNq1H5P97HU4insIJ16Ya0SCDUxVtO DTxMCUtk9M7W/2nEe2C1pMLdV+CHCXCX1h851oHkgrfNACBobIVUurGrNl8B4eR8DSEIdDtGUFEPX ibBBJD3GZ5kEIlFiBfPwbocQCgXMHIMTwStDC8WVfrmUbyXw19PywtaRPFJeeYHzuIs8NmhUZFBzS 7lfMBvohtKfhk0A8CfSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r6FRt-005bSR-1e; Thu, 23 Nov 2023 19:33:17 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r6FRp-005bRo-2K for linux-arm-kernel@lists.infradead.org; Thu, 23 Nov 2023 19:33:15 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 057D961576; Thu, 23 Nov 2023 19:33:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E872EC433CA; Thu, 23 Nov 2023 19:33:10 +0000 (UTC) Date: Thu, 23 Nov 2023 19:33:08 +0000 From: Catalin Marinas To: "Christoph Lameter (Ampere)" Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Anshuman.Khandual@arm.com, Valentin.Schneider@arm.com, Vanshidhar Konda , Jonathan Cameron , Robin Murphy , Dave Kleikamp , Matteo Carlini Subject: Re: [PATCH ARM64]: Introduce CONFIG_MAXSMP to allow up to 512 cpus Message-ID: References: <6a854175-5f89-c754-17b8-deda18447f1f@gentwo.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <6a854175-5f89-c754-17b8-deda18447f1f@gentwo.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231123_113313_807603_9941508A X-CRM114-Status: GOOD ( 17.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel