Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp868640rwb; Wed, 26 Jul 2023 04:21:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlFLkN33mjFgwCZVHM5muKwsCs76MQ2DMR+9cpIlu0T6d0tWSjLiMkj1uvBIZ4bJUSvGAYLb X-Received: by 2002:aa7:c912:0:b0:522:2af3:4997 with SMTP id b18-20020aa7c912000000b005222af34997mr1250690edt.15.1690370492368; Wed, 26 Jul 2023 04:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690370492; cv=none; d=google.com; s=arc-20160816; b=fhA+cQhOLddVWm7qX1EjWoyO/VyDRi5Y7RW0tXrJt2F5bs2JlP3GXVy+uAawon/82A 1/XDqUMbga6bO2W40NBejYkXMlNRs7oQ3t0Hvi+XR9ZIv7LYiUSYRSfknPmqEOX5kr52 Rwl+H2Q1+L5ClM8qErI5d2MBdp1mCcUAmsAJV6hsHXzNwntDKEUIiyObowqP8e4LJ3EO wrI+FrvuKkglim7V7pyJMYVRasUy58PJZg3HArB08qxXthl2Sg43vJdLJQRrxJU6I9Ok 0C52VwSTCWYMqyuhUKpmu8D9lANXhARNXu2Nr499wuTTwy96R6PnPbgBL8lhmOlh/Zh8 AGCw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=iwm9DkoXLBxio5wlQLJ5lOhkwwAE6xJtKQSzoG6WzoY=; fh=7mShmVuH9suBfBzgvZMyGTZzqI3OVCsEZy4ihinIHw8=; b=ht7Aw7jDr9NWqVz29/uM3NqQgcwgtVbV/aM9NCeYAA5HPZnR594PR1mn2SA1mCxjr+ XEutCHODF3ff7meoetGyGvYwsvavsGFAlt/mzJccb8RcUT4s4J9hKsKKC7geJ2XSbsex pE2H1X9AFiSw7qq64vNKKjlk05v2IYIwhkCC5P0JxL6L9iIg9TGaX/XcD9tbs/Q7lVgG kot9v09n3K+wZvofo0u1In1EE4AitmsK0wGTzZbcow3JaeMJskcCcpIXUq1t/hKfaAFT LoKp+8r0KAA3SW9vc+6orG2JabyezVnSEH/qCue49ksdpYiYQzH715SYbIcnb0jKCH2i 6gwQ== 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=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c3-20020aa7c983000000b005221e2f99e6si5786075edt.506.2023.07.26.04.21.06; Wed, 26 Jul 2023 04:21:32 -0700 (PDT) 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=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233802AbjGZJwz (ORCPT + 99 others); Wed, 26 Jul 2023 05:52:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231674AbjGZJw2 (ORCPT ); Wed, 26 Jul 2023 05:52:28 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DDDFB2D67 for ; Wed, 26 Jul 2023 02:52:07 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6C4B9169C; Wed, 26 Jul 2023 02:52:50 -0700 (PDT) Received: from e125769.cambridge.arm.com (e125769.cambridge.arm.com [10.1.196.26]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 30CED3F67D; Wed, 26 Jul 2023 02:52:05 -0700 (PDT) From: Ryan Roberts To: Andrew Morton , Matthew Wilcox , Yin Fengwei , David Hildenbrand , Yu Zhao , Catalin Marinas , Will Deacon , Anshuman Khandual , Yang Shi , "Huang, Ying" , Zi Yan , Luis Chamberlain , Itaru Kitayama Cc: Ryan Roberts , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 3/5] arm64: mm: Override arch_wants_pte_order() Date: Wed, 26 Jul 2023 10:51:44 +0100 Message-Id: <20230726095146.2826796-4-ryan.roberts@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230726095146.2826796-1-ryan.roberts@arm.com> References: <20230726095146.2826796-1-ryan.roberts@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Define an arch-specific override of arch_wants_pte_order() so that when LARGE_ANON_FOLIO is enabled, large folios will be allocated for anonymous memory with an order that is compatible with arm64's contpte mappings. Reviewed-by: Yu Zhao Signed-off-by: Ryan Roberts --- arch/arm64/include/asm/pgtable.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 0bd18de9fd97..d00bb26fe28f 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -1106,6 +1106,12 @@ extern pte_t ptep_modify_prot_start(struct vm_area_struct *vma, extern void ptep_modify_prot_commit(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep, pte_t old_pte, pte_t new_pte); + +#define arch_wants_pte_order arch_wants_pte_order +static inline int arch_wants_pte_order(void) +{ + return CONT_PTE_SHIFT - PAGE_SHIFT; +} #endif /* !__ASSEMBLY__ */ #endif /* __ASM_PGTABLE_H */ -- 2.25.1