From mboxrd@z Thu Jan 1 00:00:00 1970 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 34554E7544F for ; Tue, 3 Oct 2023 12:06:07 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vaFu+2EvJ8oaK6eo5xGUETjgaRsZ54lwXQxH4Bzmp+w=; b=omOGEablC4zRr5 tBfAT8G4/AnL9Xs5m18c5I8ZaafcEe9KwO6r6rjwNF8v93kg1BP9+MHNdQb8c9qhaQnqKAUcHRCO5 vfQwp0r7SC0orJQ7QOEenmZRmEmVHU2o8DgLvvyIrWW4jIczSiyyfSTdkFMZwQ5vNbA2fQvpvWhD8 PWkRFrIzgSDxfsQn5+J0MFPu2lLFYC7eaeORCT2pOnLp9y4AAcyWfKEGmDJIuksPKIyvs/CAVDjSx +ZLU58L3tfwedtcX7syViLd/aVJpmk1eEHxpidizONCqM1KotlLjXVW13HF095kpUnDWE4vKqiOiV AcCsQi+/ZFgbzU+3sZFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qne9k-00Ea91-35; Tue, 03 Oct 2023 12:05:40 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qne9f-00Ea7J-12 for linux-arm-kernel@lists.infradead.org; Tue, 03 Oct 2023 12:05:39 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 73FF5611C3; Tue, 3 Oct 2023 12:05:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9032C433C8; Tue, 3 Oct 2023 12:05:27 +0000 (UTC) Date: Tue, 3 Oct 2023 13:05:25 +0100 From: Catalin Marinas To: Ryan Roberts Cc: Andrew Morton , Matthew Wilcox , Yin Fengwei , David Hildenbrand , Yu Zhao , Anshuman Khandual , Yang Shi , "Huang, Ying" , Zi Yan , Luis Chamberlain , Itaru Kitayama , "Kirill A. Shutemov" , John Hubbard , David Rientjes , Vlastimil Babka , Hugh Dickins , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v6 7/9] arm64/mm: Override arch_wants_pte_order() Message-ID: References: <20230929114421.3761121-1-ryan.roberts@arm.com> <20230929114421.3761121-8-ryan.roberts@arm.com> <0fb0840f-02f0-4103-a6be-eeb4fcc16f8f@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <0fb0840f-02f0-4103-a6be-eeb4fcc16f8f@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231003_050535_427901_336E78F0 X-CRM114-Status: GOOD ( 23.55 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Oct 03, 2023 at 08:32:29AM +0100, Ryan Roberts wrote: > On 02/10/2023 16:21, Catalin Marinas wrote: > > On Fri, Sep 29, 2023 at 12:44:18PM +0100, Ryan Roberts wrote: > >> diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h > >> index 7f7d9b1df4e5..e3d2449dec5c 100644 > >> --- a/arch/arm64/include/asm/pgtable.h > >> +++ b/arch/arm64/include/asm/pgtable.h > >> @@ -1110,6 +1110,16 @@ 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) > >> +{ > >> + /* > >> + * Many arm64 CPUs support hardware page aggregation (HPA), which can > >> + * coalesce 4 contiguous pages into a single TLB entry. > >> + */ > >> + return 2; > >> +} > > > > I haven't followed the discussions on previous revisions of this series > > but I wonder why not return a bitmap from arch_wants_pte_order(). For > > arm64 we may want an order 6 at some point (contiguous ptes) with a > > fallback to order 2 as the next best. > > This sounds like good idea to me - I'll implement it, assuming there is a next > rev. (Or in the unlikely event that this is the only pending change, I'd rather > defer it to when we actually need it with the contpte series). Fine by me, at the moment there wouldn't be any user, so a patch on top later would do. > Side note: I don't think order-6 is ever a contpte size? Its order-4 for 4K, > order-7 for 16k and order-5 for 64k. Yes, it's order-4 for 4K pages (I was thinking too much of the "64" in 64KB). -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel