Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6346245rdb; Thu, 14 Dec 2023 16:06:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IEsScuco3NNyNS4oW9wYtm7siUz4Jfu43P7DqMZ1N3ycs0JQe+vGLccmJKuK4UoICwaNeWW X-Received: by 2002:a17:90a:b10e:b0:286:cc63:46 with SMTP id z14-20020a17090ab10e00b00286cc630046mr5089920pjq.34.1702598773082; Thu, 14 Dec 2023 16:06:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702598773; cv=none; d=google.com; s=arc-20160816; b=r25Ol0cwQywAYm9EZxxlvXBDumeCK848df/Y24m0FA7tIHPo8iyL+/2/YSMV5vmxnk FweSUrHYFrfuhIPrGp6pP8zFQGcD0NjoaRf+JOB4Gv7XCRb9fkVHxFgemzZa6yQS/XJO E5Pg9wAeCAV6vb1Y3Lf0PIaUFEsNxsj0ns9Xy2kK5v+nfgaaTXY3yd8v4LjdHE0SQVxT Qyx1/7YUiIRjLN9wNzAQO3nEmi6L0Fm2s3PZUn/ZGMTTBJVNxFz9GzPWcqYnXbPd4uQk Rxel+wlp/2TU/D+BAyQ3CAoTHfGDinbqloZgWLOyIN/kW+zsST7gSF3zPcMUQr20vs+t Fxpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:subject:cc:to:from:date; bh=bBtr7LN/hpfo2MNuOcxcIEm+IlbMg9kH3NHufS4DZSg=; fh=PbN0/9qzDGbjZiGib/79S/sGujsxkk4isE1h4NhX7qM=; b=FqcysDDx09Rprq3rP7BvdTjBUKVtBR8C/OAETvqyrhIS+nysOa3uYGTp/oY907JvZr 2goO83b4zXSi0I+G4zw96ejbWJaInAYhSs0cR6qqGuu4Cz8C6cuQ4x521fRfoX7ilEIZ QjjTMD/BadqOBifhDTc+OfLWaWIVZrWHmPp1VQNQEyBezULpbf1bcVogBhqNyJEs/2WE Au8kT8Lxz5Higxp5L9uu4LrDmcAxwCu1zebzlr2SoKKABjnUmJ4d1TVhm4JQjHo8e0M6 gYAZlWZAXmEJ3vZNvK6tK2gEP70Qv2143+eON3ZjELzylV7x9c2svCBMZ4srzf8EAIEI gxzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-273-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-273-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a15-20020a17090acb8f00b00288814acec9si1861845pju.65.2023.12.14.16.06.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 16:06:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-273-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-273-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-273-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B8F77283C55 for ; Fri, 15 Dec 2023 00:06:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 471AD81C; Fri, 15 Dec 2023 00:06:02 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from gentwo.org (gentwo.org [62.72.0.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 859507EA for ; Fri, 15 Dec 2023 00:05:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=linux.com Received: by gentwo.org (Postfix, from userid 1003) id 8FEFF40E8E; Thu, 14 Dec 2023 16:05:56 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 8D6B440E89; Thu, 14 Dec 2023 16:05:56 -0800 (PST) Date: Thu, 14 Dec 2023 16:05:56 -0800 (PST) From: "Christoph Lameter (Ampere)" To: Anshuman Khandual cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Valentin.Schneider@arm.com, Vanshidhar Konda , Jonathan Cameron , Catalin Marinas , Robin Murphy , Dave Kleikamp , Matteo Carlini , akpm@linux-foundation.org, yang@os.amperecomputing.com Subject: [PATCH] ARM64: Dynamically allocate cpumasks and increase supported CPUs to 512 Message-ID: <794a1211-630b-3ee5-55a3-c06f10df1490@linux.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII Ampere Computing develops high end ARM processor that support an ever increasing number of processors. The default 256 processors are not enough for our newer products. The default is used by distros and therefore our customers cannot use distro kernels because the number of processors is not supported. One of the objections against earlier patches to increase the limit was that the memory use becomes too high. There is a feature called CPUMASK_OFFSTACK that configures the cpumasks in the kernel to be dynamically allocated. This was used in the X86 architecture in the past to enable support for larger CPU configurations up to 8k cpus. With that is becomes possible to dynamically size the allocation of the cpu bitmaps depending on the quantity of processors detected on bootup. This patch enables that logic if more than 256 processors are configured and increases the default to 512 processors. Further increases may be needed if ARM processor vendors start supporting more processors. Given the current inflationary trends in core counts from multiple processor manufacturers this may occur. Signed-off-by: Christoph Lameter (Ampere) --- This was discussed earlier and this updated patch was proposed at https://lore.kernel.org/linux-arm-kernel/6a854175-5f89-c754-17b8-deda18447f1f@gentwo.org/T/ Index: linux/arch/arm64/Kconfig =================================================================== --- linux.orig/arch/arm64/Kconfig +++ linux/arch/arm64/Kconfig @@ -1407,7 +1407,21 @@ config SCHED_SMT config NR_CPUS int "Maximum number of CPUs (2-4096)" range 2 4096 - default "256" + default 512 + +# +# Determines the placement of cpumasks. +# +# With CPUMASK_OFFSTACK the cpumasks are dynamically allocated. +# Useful for machines with lots of core because it avoids increasing +# the size of many of the data structures in the kernel. +# +# If this is off then the cpumasks have a static sizes and are +# embedded within data structures. +# +config CPUMASK_OFFSTACK + def_bool y + depends on NR_CPUS > 256 config HOTPLUG_CPU bool "Support for hot-pluggable CPUs"