Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp985512iob; Fri, 13 May 2022 18:37:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxl3ZGiep/4z3YrCRmhVCMf6epJDZkFm7x7GPT8l5ZPfGV68F+0Jdhw6D/Qb1gBr317bzb9 X-Received: by 2002:a05:600c:3c9c:b0:394:8fb8:5589 with SMTP id bg28-20020a05600c3c9c00b003948fb85589mr6850205wmb.13.1652492238606; Fri, 13 May 2022 18:37:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652492238; cv=none; d=google.com; s=arc-20160816; b=FFCuIaYA3oTNPWq+a1O5IUVBNg1YLiQd3TVLQAC6qoU5VezmZ6jzBbvOIxxD2A11Cr BFsCiKq1ukAgkjTn2N654qIM10APbNBY9NSjLeMF7MSMKOVpnzDhCdL9IAdR24qgvDY3 zbI346HBLXD7ApZzXFpwLu7mTZlBxzIc1HTDA1JDgGvARojkhCzK9LTHzDWqyZzLxzvi yqEP+vT/HnJBaz7j/Srhnl1I4wyVaODVaxshKiYQtEfAoPb5Mw0FCyturJoejgB2etM1 9HSqG03nbIczOVbc2qwlG7zhFh3vVJYymt6/DOLnlWkwUv05b8gt325IbdyUqpuPOcl2 bCxg== 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=RjgsSzlCD4TkMb3VPRi7pca6XfGfYkGEK7+rGUicWyk=; b=FEFBqJcLUBguAMzf/zYu4KhGu11QXG3vJEGXTdph5f+BbZ3tMH/X4WiU233KwM2yTT ht7B2ywO5xqN9Cvw9n1vET7kh17/bstr3QVLcA/QK4zFSsQ2NctQ75DGZsIS6QPaHWCT WqChIF31uuFGn5B94XiLBfCNnLNbjyfZbn1w/PsrjZ2T2FKxm8fb26mF6pr8SfNhVQEq CnRgG3oaobm0z9D4Q/VLc1cN7hmUI+fpd38AXu+Q4w/4DeO152RE+C9s8qqMWQ0R/TV4 NEGkCW1S+kwO2PY4cDSSf0OREIEZYbJnEASILqYopt4EeoXNltZgwddLbWjxLPFCKds3 vi1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c129-20020a1c3587000000b0038ff3121461si6847460wma.141.2022.05.13.18.37.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 18:37:18 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 32DD12A805B; Fri, 13 May 2022 17:04:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352928AbiELLHz (ORCPT + 99 others); Thu, 12 May 2022 07:07:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240084AbiELLHv (ORCPT ); Thu, 12 May 2022 07:07:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 262CB52E63; Thu, 12 May 2022 04:07:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DA76BB82792; Thu, 12 May 2022 11:07:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07451C385B8; Thu, 12 May 2022 11:07:44 +0000 (UTC) Date: Thu, 12 May 2022 12:07:41 +0100 From: Catalin Marinas To: Stephen Rothwell Cc: Andrew Morton , Will Deacon , Anshuman Khandual , Baolin Wang , Linux Kernel Mailing List , Linux Next Mailing List Subject: Re: linux-next: build failure after merge of the mm tree Message-ID: References: <20220512193855.4f6ce32f@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220512193855.4f6ce32f@canb.auug.org.au> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Thu, May 12, 2022 at 07:38:55PM +1000, Stephen Rothwell wrote: > After merging the mm tree, today's linux-next build (arm64 defconfig) > failed like this: > > arch/arm64/mm/hugetlbpage.c: In function 'huge_ptep_clear_flush': > arch/arm64/mm/hugetlbpage.c:493:16: error: implicit declaration of function 'get_clear_flush'; did you mean 'ptep_clear_flush'? [-Werror=implicit-function-declaration] > 493 | return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig); > | ^~~~~~~~~~~~~~~ > | ptep_clear_flush > arch/arm64/mm/hugetlbpage.c:493:16: error: incompatible types when returning type 'int' but 'pte_t' was expected > 493 | return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > arch/arm64/mm/hugetlbpage.c:494:1: error: control reaches end of non-void function [-Werror=return-type] > 494 | } > | ^ > > Caused by commit > > 00df1f1a133b ("mm: change huge_ptep_clear_flush() to return the original pte") > > interacting with commit > > fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()") > > I have applied the following merg fix patch for today. > > From: Stephen Rothwell > Date: Thu, 12 May 2022 19:33:11 +1000 > Subject: [PATCH] fixup for "mm: change huge_ptep_clear_flush() to return the original pte" > > It interacts with commit > > fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()") > > from the arm64 tree > > Signed-off-by: Stephen Rothwell > --- > arch/arm64/mm/hugetlbpage.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c > index 5bdf913dedc7..30f5b76aabe9 100644 > --- a/arch/arm64/mm/hugetlbpage.c > +++ b/arch/arm64/mm/hugetlbpage.c > @@ -490,7 +490,7 @@ pte_t huge_ptep_clear_flush(struct vm_area_struct *vma, > return ptep_clear_flush(vma, addr, ptep); > > ncontig = find_num_contig(vma->vm_mm, addr, ptep, &pgsize); > - return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig); > + return get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig); > } Note that after the arm64 commit, get_clear_contig() no longer flushes the TLB. So maybe something like: diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c index 30f5b76aabe9..9a999550df8e 100644 --- a/arch/arm64/mm/hugetlbpage.c +++ b/arch/arm64/mm/hugetlbpage.c @@ -485,12 +485,15 @@ pte_t huge_ptep_clear_flush(struct vm_area_struct *vma, { size_t pgsize; int ncontig; + pte_t orig_pte; if (!pte_cont(READ_ONCE(*ptep))) return ptep_clear_flush(vma, addr, ptep); ncontig = find_num_contig(vma->vm_mm, addr, ptep, &pgsize); - return get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig); + orig_pte = get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig); + flush_tlb_range(vma, addr, addr + pgsize * ncontig); + return orig_pte; } static int __init hugetlbpage_init(void) -- Catalin