Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1908471rdb; Tue, 3 Oct 2023 05:06:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGS65l9JFLecAC/GgEGYCGzi60gGAVrpxwYpW2DZDaE56m67tC4gULSwAXZoSY+uZzhSr6v X-Received: by 2002:a17:902:e803:b0:1c6:2acc:62ea with SMTP id u3-20020a170902e80300b001c62acc62eamr15117030plg.57.1696334770357; Tue, 03 Oct 2023 05:06:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696334770; cv=none; d=google.com; s=arc-20160816; b=hRkCoKr35ldz13QPj4t5AlBCdA+mrBzi4NUVOnMKp0HP+jxIHECil0xfiZR5l4E/3A Jk5pcmoPJVywwvHkPmxbsGvHj+/60csDlb/ZqxFf9a5NxWwkNxAyHsT9fLERv6fE09zi WZI1yXvm2frSVHd5ZAc0Mrro1uHfJlnib9mWI1KtjorB6pBNp+iUSqJmXqnbwVmEk3gb O4vmfTkdLi716oOLsC+1+jUvSK+lj2y95C1Sm0FST5gco74TlFg5icCFKXw1rpKJqaAi k1B79tNo/1HmJfYgWf2Gq057Do6Qzj6AhL59uyev5m1EOSVi6d/5vKxGj2EOLUhz+SpY 312Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=zzaBO66vi5SBS9J1N+VMxMm4ga5mTKjaapifhUTP8ME=; fh=ejdbKhoyG9D3o5+YavsSPOlPbWn49vkd/QCH3HUBHc8=; b=WuLvS8WGqodMEzUH0e8UQjV8UPrgMuvj7ytJOnb/ls2pC8BeFp9q5RTZGuFV/629Tr dFsFduJhyOUtq+sqJtPWL4p28OJPw5s2LB1wUwhAsunbT6AXzwDnoJdJTsxgHtosfpmi 6YiGej0QbOSyAcqVSbZLdtA8s8ExtVJGN4CquhxnAF6LV6tKrJ8/Z60b7aVK9Ba8hWBZ TeYTyV9vIOt/W9lDxHk2L3KQycsKc0xCHA9hgRtrdrjP/i/k/EAuoGd63Bw7a8N92yoO YRUjudhHM4HuS7FKoDqmwj8K5QCMuSArtuDhWxS9jX4CR3Osa/9p7NzCTISUAQjQutf6 9rhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id c7-20020a170902d48700b001c741de8529si1276738plg.380.2023.10.03.05.06.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 05:06:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C1E8E80747B1; Tue, 3 Oct 2023 05:05:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231909AbjJCMFg (ORCPT + 99 others); Tue, 3 Oct 2023 08:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231889AbjJCMFe (ORCPT ); Tue, 3 Oct 2023 08:05:34 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85CD5A9 for ; Tue, 3 Oct 2023 05:05:31 -0700 (PDT) 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0fb0840f-02f0-4103-a6be-eeb4fcc16f8f@arm.com> X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 03 Oct 2023 05:05:47 -0700 (PDT) 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