Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp13189954rwl; Wed, 4 Jan 2023 04:58:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXvvKLZ1mDltvm5GSsDysRFc0BakNaW1rwII+1KYqJo1HkbKW/xsBHTCdqCQfsSe0ZPSMw80 X-Received: by 2002:a17:902:b207:b0:189:e3d0:daf8 with SMTP id t7-20020a170902b20700b00189e3d0daf8mr47420488plr.55.1672837111891; Wed, 04 Jan 2023 04:58:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672837111; cv=none; d=google.com; s=arc-20160816; b=broXp9werEGSNfbmaFT5An/5uviiaE22UGrzHEDO1OOkD38V1EDIv6IyFrVGH6D/Nx wJwN7bD9zt3hULijxvZz0xh1RkSA/UfGhQ5R7KuI/EglDb7Lr+xe4XLRVpSNEAawASsz CzWVfJx9yxNYkFDNMCYePTfiGCZRftTtYEZ4h9Y3mdnNkWSQo+wBdhGfJ9YpSP2HKeXv sJdLINlNW3i0eZNE7zkz/mObFN106Ojp6NMInhiIJvpmcv8EOJopbNI3bNgofYPkqEYS 2AEmCuo5Kzwgzx6CHzOCBnW+hpmKkkNubexk/fngj2UIh7+CPRwdlTcs1W6JwteeckeD ky5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=EWGMnL3jXVAffk3q4JaJvRT2TXCb5kSPmu2MfbBi21U=; b=oY0uevqH7vFT0EjvEwakXHPILyJLdcGFJoRoHp0as88uHkGcy6VNuR8KZ5l/bjLxG0 0aO7YtTa1Wf4cimriC/IHUTp1DduZiWuupWAR/Id/beXugRtCvA7n6TZFKGP8LQ+x1QD slH63mQephubu3o0trkkG/9vFFB6zGZ78pOJqN2/JpBBb0ORwvzckiyAqfES4oFAO3Ns yerdMFENmatEV+Jai5RYq9QxYiAeGJyhUgjH63nXrvQX8AgQyY1kTETmQ2xpUsy9a4K1 S1y0sesPGekOp5O7Qa3itlCC8q3pWlEdJm9fysjlf8ErpCX3qTCtflDXooj4bHDNNLuz n0Fw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m3-20020a63fd43000000b0047915d92e71si34959336pgj.185.2023.01.04.04.58.24; Wed, 04 Jan 2023 04:58:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239229AbjADMoc (ORCPT + 59 others); Wed, 4 Jan 2023 07:44:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233514AbjADMo2 (ORCPT ); Wed, 4 Jan 2023 07:44:28 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE48417E0F for ; Wed, 4 Jan 2023 04:44:27 -0800 (PST) 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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 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 -- 2.35.3