From patchwork Tue Feb 6 18:09:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Christoph Lameter (Ampere)" X-Patchwork-Id: 13547688 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 ADF20C4828D for ; Tue, 6 Feb 2024 18:10:12 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References:List-Owner; bh=oohQlb/J3l5Qf+IhXrBxICRmO+V/qqXdupuBDClgYKA=; b=mKSrstRBwNTCMBkeM/XTOoi09S g6dV+sQF7eJY70YbJU7ljz6nFJsPIGzkAkr54B985TGVf9LyM9Em9isHRNafBX4SFWiAMTmAfFlna VosrBTZpM9hk7VpO9TcV4epHIr3V3wQ5+mBwhQqAM6ExDXhRkDc9jpraaqDOTW+owTRjfubdBkeqm 55piLZcr2tDbw9671Wfy9WQeSck8lj7p+MRhzPDfoKDkzNRg2sZ3BSydmoNAamLxuRbVBG+i3jySc QQbIeMPf48b++qm/XHOMCh0VEUoe4Sa02wC/awQenLGJfTSdEd+Xls1T/wHYi5oB8AJrke1b/UjCK /wuc/96w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rXPtU-00000008Ulj-2kZt; Tue, 06 Feb 2024 18:10:04 +0000 Received: from gentwo.org ([2a02:4780:10:3cd9::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rXPtS-00000008Ukr-3bA4 for linux-arm-kernel@lists.infradead.org; Tue, 06 Feb 2024 18:10:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gentwo.org; s=default; t=1707242999; bh=Kxq4sAvN5Fs2sIsPglHruFBuErxB15QsWcASPc5lT0Q=; h=Date:From:To:cc:Subject:From; b=dHBKmQ4BHy52GP3uyL/6OewvtDCvQAl73DQsCoM3ERD4Zt3W7zQRZ27bJRXFJI5Eg VxeVaHDzouRpY2ewEI0xXRnrTP9FzGyA3S9hx4GEjc8KRBozUMvFtnso8CTQ7VpZUK K1zSEx7Q4+RYHO7sR23yOjTRfUNo68EIjhXI8hDx/V20gjUG2bDjM5L6zApYfo//pA k5DaKUu0lrD3RJCqSgFZ6M4/YnoHVWiXDLoNiSbV8QE1EfaUie4Q8t1cLskKuicRY2 js6kn6JI9WFsohDyHKW8tdZn3p8PMGxVV6m2Q5upOLldNy113gSO/vRCZA4ENtK8S5 yAs6BEbzEfbBA== Received: by gentwo.org (Postfix, from userid 1003) id 8475940A93; Tue, 6 Feb 2024 10:09:59 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 83AC940788; Tue, 6 Feb 2024 10:09:59 -0800 (PST) Date: Tue, 6 Feb 2024 10:09:59 -0800 (PST) From: "Christoph Lameter (Ampere)" To: catalin.marinas@arm.com, Will Deacon cc: Jonathan.Cameron@huawei.com, Matteo.Carlini@arm.com, Valentin.Schneider@arm.com, akpm@linux-foundation.org, anshuman.khandual@arm.com, Eric Mackay , dave.kleikamp@oracle.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux@armlinux.org.uk, robin.murphy@arm.com, vanshikonda@os.amperecomputing.com, yang@os.amperecomputing.com Subject: [PATCH REPOST v2] ARM64: Dynamically allocate cpumasks and increase supported CPUs to 512 Message-ID: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240206_101002_948503_08C7C99C X-CRM114-Status: GOOD ( 12.81 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Can we get this merged for 6.9? The patch has been around for awhile now. 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. Tested-by: Eric Mackay Signed-off-by: Christoph Lameter (Ampere) Reviewed-by: Russell King (Oracle) --- Original post: https://www.spinics.net/lists/linux-mm/msg369701.html V1->V2 - Keep quotation marks - Remove whiltespace damage - Add tested by 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"