Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp564649rdh; Thu, 23 Nov 2023 11:33:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHn+3ajg8AQ1s57uGmyolFHIZAFPLGhOgyru3VmhtJPuSeC/ldyXX39y74R8GGnZe6KUgwg X-Received: by 2002:a17:902:d50c:b0:1cc:33f1:3f03 with SMTP id b12-20020a170902d50c00b001cc33f13f03mr434839plg.2.1700767998970; Thu, 23 Nov 2023 11:33:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700767998; cv=none; d=google.com; s=arc-20160816; b=YbzPs/+O0d/ZGmh+osRa0gZyCSpej3Imi2BV5d7huMKQblHYSKMJTpKVX3Y5SHYVFW WaubZzpCCskw/a2mxp+kKdQ5iGAgIi4dCRwcarr5c9pkpzoajUKcoo0d3/JeS/Uu56uB aJBUjBLP/saRlpI81wKOlHLNVGrMC6ltc2ybsyR9QPJNkoe41AXyYv9NGXKpkUiL6wdA VTFT6+CMheT/+crvZb9lt22QhoNQHwRJX/JIrVLLmsD+qsdnCQJoZq2PrgqAnXfNQW1H oHsv4BmxUsxRDSqsKu/8tX1ZV2CcmqYZIES4ahJcNk2v4TYbfoPSEstr/eVM5zo5bmSV /hIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=xUoD6DVueD0siaL5ZYzypVbqoj98eqPbDlKMFi+zLaQ=; fh=rR2pNIblbPQk8mn5KsvHfbKyaPq74sA3a0Wz6Rq3eDM=; b=hqH6iIYT/vyGSHg66jA4rupsDZFJYN+1vHRCAUN7PGTRes2mCAKhAH8Oy2s2G5nQAV 3x/3LBsMhcym6K7/+7n0S8mD/lU8gVkkI5/3VKX4bzmugX6Bkk8RX6otflWlKNNCbYip Q244VUFn56CbOejR/mcls1SdWDZj6Pzn1yCC14HFxOGf9WimCtE8kN8NqAQU2ueDuhJh 9l4HePfCqNXjQQFRAZ+CaBIjDvj6WhqvQPUl8/JD/9vdfQwk97uEgkFJwdVh53NJYgEe KPjHjSEBgOh0ukMJU9A9f9+tGM4F1Uidfqw218BXqIKUtk6rXLHpDsAnQ08kRLy1TRdR fRYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id z6-20020a1709028f8600b001cf8b399006si1647097plo.189.2023.11.23.11.33.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 11:33:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CC9B681E14DC; Thu, 23 Nov 2023 11:33:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229525AbjKWTdH (ORCPT + 99 others); Thu, 23 Nov 2023 14:33:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjKWTdG (ORCPT ); Thu, 23 Nov 2023 14:33:06 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A473D59 for ; Thu, 23 Nov 2023 11:33:13 -0800 (PST) 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6a854175-5f89-c754-17b8-deda18447f1f@gentwo.org> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 23 Nov 2023 11:33:17 -0800 (PST) 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