From patchwork Wed Jul 26 09:51:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Roberts X-Patchwork-Id: 13327783 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 DC0DFC001DE for ; Wed, 26 Jul 2023 09:52:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 72C1A6B0078; Wed, 26 Jul 2023 05:52:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6DC4B6B007B; Wed, 26 Jul 2023 05:52:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F2ED8D0001; Wed, 26 Jul 2023 05:52:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 4FFCC6B0078 for ; Wed, 26 Jul 2023 05:52:10 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1443540212 for ; Wed, 26 Jul 2023 09:52:10 +0000 (UTC) X-FDA: 81053297220.06.384F16A Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf13.hostedemail.com (Postfix) with ESMTP id 5934C20016 for ; Wed, 26 Jul 2023 09:52:08 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690365128; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iwm9DkoXLBxio5wlQLJ5lOhkwwAE6xJtKQSzoG6WzoY=; b=qwDwRYVaiJFY7ro/KajSWcJEjYtfMsdo75Rex17Go18R817+e6/DGN96FDLpaIaaCL7ESq +3FKK+tEOZwq7gvML6xbC8TXUw7I0w6S33KAlot/fwZs0HCGcJJOATuIljXtqxi+OEferV aAUxC/4U5GdCFb/Fg0wlB68o+lc7Fjo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690365128; a=rsa-sha256; cv=none; b=G+Ii9rEQ0oSSJzTPNiVfgSxU0xz1fBUTI54/qFokGTtnU6eybSTpnoXtbSLtIPce59cJRa j8MoOpLJqaSquQSqgB1j749mV6nDek/OkEB7YErz1G4p5/gv4qjCWjXGpl3fmSFTLfxr72 Xd8MEV014jrARaabmw1ywfdds0E2gm8= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com 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 X-Rspamd-Queue-Id: 5934C20016 X-Rspam-User: X-Stat-Signature: uap7a16dgkqjctf9bz7u8uzxar7i7jno X-Rspamd-Server: rspam03 X-HE-Tag: 1690365128-547312 X-HE-Meta: U2FsdGVkX18+yL2FZU7C58CDbaWOWRU9dclHh+0XvCWmBTuKKojKC1/d/4Mw7Tz2Mc/1oD5uNWp+6vfsst0PFSXntDB1FQtbFyr2ja27VTur64ho7hHztEHSfxLD3yaWR8zR8R8VHBLZ9oAEc3nhYZYBii3Qp87s4rb/63qkU3/65a+HpYzxtNXDzUQxMiQYK/gYo50I2YlKtuwMhgDLV5afNZ2wgNbLkQOPdxO9TL1uo6nOR4858FtMQbeE9+7ePI7/M7uFbn18yMOz54JjuqMybZlTmZPz6bLpPrZK7Xq3H9kqOVXQZtfCKlPw+HGM1fz1Dv9rGaxijRGSLeLEHAU5aH1Aive4N2tocKvc2ROtdW1iSj52y0qu9kt1H1qqoxvexDH667Lwx3iAXsY7A4wYj1nZERrF2B8PXMMuv6dUz52eHr1vBDxAPlDsRQZpxe40X54hA4CzpK08Ydp1yrFfJoUA0PXdSGsPj4EZcEQBhJl9znIfsnou90+8Q5M//bpzpl29NOw+W/MRSNfqAMJDgfbeQzh5pX+uoVO+2uXvvoAnq2xussDDGHDvcuwLlvD7W05X829JJUYuSqMjsdK8tl+3t3XS5vEVIinb0MNfYSLC1gzc+Etb/wzG0SMPZTcytzu1HoRIqpDgWuElezFeTSrRUhc+3u0m5vlg5UoyK7ad/hcXxPMlJUaAMz67TrZ7qOhLzMpd1yXyJH/1YNkpkBnZb0L233qWEKRwTKkR5g0Rc0MAzprPY3c3eHQc5g/Yf91yswiiNEpDxIY8ajDdKDS5m3TbLyICBmQoPBxXnHUUiF+W0d0msqVLYSpfD4K7nEZkNXghRI86EV/nG2eyFT487imCNeSvhEWFHII4s2AE/x6D3kQ4k4xey8ydUK9AnXJONacWRuvw3rQNN2mHSWnFCAscy/6xf+CLwTVFFrgtHu77JrFW78BwJEdmwp848MTub5+1XFhAx3/ zKMfOfPx euD+KFisAkqL5ELgHKYR98w0txlhPzC7AeIOd/B4qcxa44IiQ314UVlVZUJjYY2R/Tj1GsNIeB7vGCjmQGFBIF4A4iP+TBnft0VT+iK6Nq/rhdhKKDSxOQIc8++z78KYUgbfF0oBkxrF7JMkBdMpAIeEWmS0xtHOyBD5yiZlpCZQi6IKd9n5ujd4o1FivuWBYmqwc7J/bBhwFxPOPWaTcJ96lgBayaF3ZhvARvRwL24zado8pAudI0ovWxCVjRl2SPbWxwNqcNeI+OJVxpGrArYWudacntkJGj6uTSeL7Hmj6yT4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 */