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: 13547686 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5E36C48297 for ; Tue, 6 Feb 2024 18:10:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3D2CA6B007D; Tue, 6 Feb 2024 13:10:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3832A6B007E; Tue, 6 Feb 2024 13:10:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 24B586B0080; Tue, 6 Feb 2024 13:10:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 1326C6B007D for ; Tue, 6 Feb 2024 13:10:04 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id A6213405FB for ; Tue, 6 Feb 2024 18:10:03 +0000 (UTC) X-FDA: 81762167886.29.BAD7838 Received: from gentwo.org (gentwo.org [62.72.0.81]) by imf11.hostedemail.com (Postfix) with ESMTP id 0E31D40018 for ; Tue, 6 Feb 2024 18:10:00 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none ("invalid DKIM record") header.d=gentwo.org header.s=default header.b=dHBKmQ4B; dmarc=pass (policy=none) header.from=gentwo.org; spf=pass (imf11.hostedemail.com: domain of cl@gentwo.org designates 62.72.0.81 as permitted sender) smtp.mailfrom=cl@gentwo.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707243001; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=yymB7BO8tU80FrwCgGeJ6JKl5QinB238RD5EgM+7O24=; b=GSXBlzTxMZXv511/LAC3JT9TBl5EXcOVxJN4Dr1z1xjybYH14EJMYmIB64b3nYLOiExEqG bVK50+ruwFjqz7BvSdKQ7xqxB2gkirwlVptsPaNhYIwmSibaVBowMuhnMLQbYd8xaOkTUl 7Gt6VRRP1YHGqLHlleCTyuUhfOv/LMI= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none ("invalid DKIM record") header.d=gentwo.org header.s=default header.b=dHBKmQ4B; dmarc=pass (policy=none) header.from=gentwo.org; spf=pass (imf11.hostedemail.com: domain of cl@gentwo.org designates 62.72.0.81 as permitted sender) smtp.mailfrom=cl@gentwo.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707243001; a=rsa-sha256; cv=none; b=Iik+cVjw6R+oOCH09ZY6wDWk/nvDUsHbKp94qCFpB7UEh7TkFbl3c9cjp42nE2TAobPkgP ebt/DUBTfqP1X7rM+NpQxMM0/6oW3h0Zf1BcKgPdF5FE5QhDpI5VUXmkXKfuCrV56Ri9mh 1/TIAeL08us08mVfA7xFWw4FEv5DBNQ= 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-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 0E31D40018 X-Stat-Signature: jxtnmmg1mq1h48w4kwmrmschz7ckecgf X-Rspam-User: X-HE-Tag: 1707243000-246419 X-HE-Meta: U2FsdGVkX1+nbOHwwEkovpdWPGl7KLhHWPTeyR5c5lXQYGNOxm1k5SQ/FVE0fBMxwpcarNjz6ql8wnLIz9tmnd/rKI10O1pvcVkC+XmZu8AsC/pOVKbH3nSQNkezwL6trwvprMd+keM1BiDZslLQD+dYZb2Gs1XcPsHIkUfHhJ2z0RrwP+eEHtrhgNomdFVPYOZyT74Ao0Xj6hWXw95JGZXRlOkEP06FsJUuEpmo0eurqXsuFti2z9mcIQJdW39vODXNWem5v+iGUi4ZexVyscAqxZmGnBGlSb5DeCovj3K1h5T/6usLcZDddwryeAdm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bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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"