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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9FCCE728D7 for ; Fri, 29 Sep 2023 19:08:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233869AbjI2TI7 (ORCPT ); Fri, 29 Sep 2023 15:08:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233837AbjI2TIx (ORCPT ); Fri, 29 Sep 2023 15:08:53 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FF8B193 for ; Fri, 29 Sep 2023 12:08:51 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD6AFC433C8; Fri, 29 Sep 2023 19:08:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1696014530; bh=bHODacq6grsBpgc3/otmKKBw85dJ3LRYP29v0l1hMuU=; h=Date:To:From:Subject:From; b=2RmUk8nzA3PC/w20KlBiKwzwX0Nd0+3BIHXa8KhfP+hFyiErRYfZXtuif2IYgPY1L iJz46XZ8YQze5IOPAEkv5nijTF2sKpo0u9X0Ew9TfQfRHeGHd43qHhMaQByA5g5a2m wi9hZEVY1PQJYhpPHyvKFEnh2xch4cjkDF0lko1k= Date: Fri, 29 Sep 2023 12:08:50 -0700 To: mm-commits@vger.kernel.org, ziy@nvidia.com, yuzhao@google.com, ying.huang@intel.com, willy@infradead.org, vbabka@suse.cz, shy828301@gmail.com, rientjes@google.com, mcgrof@kernel.org, kirill.shutemov@linux.intel.com, jhubbard@nvidia.com, itaru.kitayama@gmail.com, hughd@google.com, fengwei.yin@intel.com, david@redhat.com, catalin.marinas@arm.com, anshuman.khandual@arm.com, ryan.roberts@arm.com, akpm@linux-foundation.org From: Andrew Morton Subject: + arm64-mm-override-arch_wants_pte_order.patch added to mm-unstable branch Message-Id: <20230929190850.CD6AFC433C8@smtp.kernel.org> Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: arm64/mm: override arch_wants_pte_order() has been added to the -mm mm-unstable branch. Its filename is arm64-mm-override-arch_wants_pte_order.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/arm64-mm-override-arch_wants_pte_order.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Ryan Roberts Subject: arm64/mm: override arch_wants_pte_order() Date: Fri, 29 Sep 2023 12:44:18 +0100 Define an arch-specific override of arch_wants_pte_order() so that when anon_orders=recommend is set, large folios will be allocated for anonymous memory with an order that is compatible with arm64's HPA uarch feature. Link: https://lkml.kernel.org/r/20230929114421.3761121-8-ryan.roberts@arm.com Signed-off-by: Ryan Roberts Reviewed-by: Yu Zhao Cc: Anshuman Khandual Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Rientjes Cc: Huang Ying Cc: Hugh Dickins Cc: Itaru Kitayama Cc: John Hubbard Cc: Kirill A. Shutemov Cc: Luis Chamberlain Cc: Matthew Wilcox (Oracle) Cc: Vlastimil Babka Cc: Yang Shi Cc: Yin Fengwei Cc: Zi Yan Signed-off-by: Andrew Morton --- arch/arm64/include/asm/pgtable.h | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/arch/arm64/include/asm/pgtable.h~arm64-mm-override-arch_wants_pte_order +++ a/arch/arm64/include/asm/pgtable.h @@ -1110,6 +1110,16 @@ extern pte_t ptep_modify_prot_start(stru 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; +} #endif /* !__ASSEMBLY__ */ #endif /* __ASM_PGTABLE_H */ _ Patches currently in -mm which might be from ryan.roberts@arm.com are mm-hugetlb-add-huge-page-size-param-to-set_huge_pte_at.patch arm64-hugetlb-fix-set_huge_pte_at-to-work-with-all-swap-entries.patch mm-allow-deferred-splitting-of-arbitrary-anon-large-folios.patch mm-non-pmd-mappable-large-folios-for-folio_add_new_anon_rmap.patch mm-thp-account-pte-mapped-anonymous-thp-usage.patch mm-thp-introduce-anon_orders-and-anon_always_mask-sysfs-files.patch mm-thp-extend-thp-to-allocate-anonymous-large-folios.patch mm-thp-add-recommend-option-for-anon_orders.patch arm64-mm-override-arch_wants_pte_order.patch selftests-mm-cow-generalize-do_run_with_thp-helper.patch selftests-mm-cow-add-tests-for-small-order-anon-thp.patch