From patchwork Wed Jan 4 13:00:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13088553 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 6440AC4332F for ; Wed, 4 Jan 2023 12:52:53 +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:MIME-Version:Message-ID:Date:Subject:CC :To:From: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=kSx5zMgXnN6cZCDkhaVVEMI3LCMhhk9TPGe1scomqp8=; b=GFR7g19sD7kanh cs78buTGy5RTGaBSdU3RQmcvll/YesLNQDbkX9W1y979RhUw5Mh3P4IMFElv3ChGs1PPe5CSq67oV +x7FvqsAhxvAcDmDImRNIKPlh5ya0gfqvboEfHrO2bLN8CCeO08UeVrMjjQgH8Hp0Yvy/ewOnXUoQ 6qt72v6UfXAqBryuF+hWJUQ4jE3cClm8KmCU3EcDpzF4w4G8xU9zOyNYJXICELAJB2HNPlT9W7TtT BuQITQTQOQyeV51QwF+qhXASY5cBo+yaxjbASV3F64GcES6Ldh8b02UoypR8EG+0dOKlI6OfdnptO cgY+VVNim3Pu2ansdzZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pD3FL-0099fk-Am; Wed, 04 Jan 2023 12:51:55 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pD38E-00972N-Vd for linux-arm-kernel@lists.infradead.org; Wed, 04 Jan 2023 12:44:37 +0000 Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Nn8Ln5nVTzqTpb; Wed, 4 Jan 2023 20:39:45 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 4 Jan 2023 20:44:24 +0800 From: Kefeng Wang To: Catalin Marinas , Will Deacon CC: , , Kefeng Wang Subject: [PATCH] arm64: make ARCH_FORCE_MAX_ORDER selectable Date: Wed, 4 Jan 2023 21:00:00 +0800 Message-ID: <20230104130000.69806-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230104_044435_675177_EC84AA3A X-CRM114-Status: GOOD ( 13.31 ) 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 The other architectures with ARCH_FORCE_MAX_ORDER are selectable, but not for ARM64, this is to make it selectable on ARM64, which is useful for user that need to allocate more than 4MB of physically contiguous memory with 4K pagesize, also more bigger on 16K pagesize too, the max value of MAX_ORDER is calculated bellow, see include/linux/mmzone.h, MAX_ORDER - 1 + PAGE_SHIFT <= SECTION_SIZE_BITS so max value of MAX_ORDER = SECTION_SIZE_BITS + 1 - PAGE_SHIFT | SECTION_SIZE_BITS | PAGE_SHIFT | max MAX_ORDER | default MAX_ORDER | ----+-------------------+--------------+-----------------+--------------------+ 4K | 27 | 12 | 16 | 11 | 16K | 27 | 14 | 14 | 12 | 64K | 29 | 16 | 14 | 14 | ----+-------------------+--------------+-----------------+--------------------+ Signed-off-by: Kefeng Wang --- arch/arm64/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 03934808b2ed..22f0fb73a762 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1457,9 +1457,11 @@ config XEN Say Y if you want to run Linux in a Virtual Machine on Xen on ARM64. config ARCH_FORCE_MAX_ORDER - int + int "Maximum zone order" if ARM64_4K_PAGES || ARM64_16K_PAGES default "14" if ARM64_64K_PAGES + range 12 14 if ARM64_16K_PAGES default "12" if ARM64_16K_PAGES + range 11 16 if ARM64_4K_PAGES default "11" help The kernel memory allocator divides physically contiguous memory