[PATCH 2/2] arm64: mte: drop the huge zero folio check in __access_remote_tags()

Catalin Marinas catalin.marinas at arm.com
Thu Nov 26 10:28:15 PST 2026


On Sat, Oct 31, 2026 at 04:44:54PM -0400, Tal Zussman wrote:
> Commit adfb6609c680 ("mm/huge_memory: initialise the tags of the huge
> zero folio") added an is_huge_zero_folio() check to the hugetlb branch,
> but the huge zero folio is a THP, so it is never reached. It doesn't
> need to be checked in the other branch either, as its pages are tagged
> by __GFP_ZEROTAGS on allocation. Remove the check.
> 
> Signed-off-by: Tal Zussman <tz2294 at columbia.edu>
> ---
>  arch/arm64/kernel/mte.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/kernel/mte.c b/arch/arm64/kernel/mte.c
> index f8d39e70857e..8615732567e6 100644
> --- a/arch/arm64/kernel/mte.c
> +++ b/arch/arm64/kernel/mte.c
> @@ -483,8 +483,7 @@ static int __access_remote_tags(struct mm_struct *mm, unsigned long addr,
>  		}
>  
>  		if (folio_test_hugetlb(folio))
> -			WARN_ON_ONCE(!folio_test_hugetlb_mte_tagged(folio) &&
> -				     !is_huge_zero_folio(folio));
> +			WARN_ON_ONCE(!folio_test_hugetlb_mte_tagged(folio));
>  		else
>  			WARN_ON_ONCE(!page_mte_tagged(page) && !is_zero_folio(folio));

Hmm, I added it to the wrong branch but it wasn't needed anyway since
the huge zero folio has PG_mte_tagged set. Patch looks fine:

Reviewed-by: Catalin Marinas <catalin.marinas at arm.com>



More information about the linux-arm-kernel mailing list