Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp882496iob; Thu, 12 May 2022 06:44:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlHjjHvfEtOxZKAerFGpesVC5z4zkBPj9pTKjEpDIAg7rU5zMaWgxiphD6EdomgAeqgi4P X-Received: by 2002:a17:906:11c9:b0:6f3:b767:55ce with SMTP id o9-20020a17090611c900b006f3b76755cemr10146eja.280.1652363049866; Thu, 12 May 2022 06:44:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652363049; cv=none; d=google.com; s=arc-20160816; b=zEVCjTvesV1Gk+PnfErAj/f6CDrt5Hzc+upB6qHW32Bp4Vi1/pQX5LDY7WwL0Sy+y5 l8FVLaTaGZMcPC8pRqoyo1lakjQs03G9lRQyxMZc/kuUaaRTBW9BHrUJAKbzwU4Yvaev lFkOuT5xca00RIqVpmegy19doH9hIeNYq5/4iccKJSmypB4Z6/qfaJezI5Zb24h5sFQs nqa8j1pqtzjLSA0Xo7kiRCBT49ULE+C14e/mFjGSrS3m4m4kNWbSiftlMtiY3WAVO9eN eAR5uMTZytj7I7J3miydMFyCvxbMNuRGYdDHwOefNIq9T1WbLAWJ0PjbzI2qGVT0Tol1 tUpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=cHw+dOMORgVWWgNiwTDdZzp0s8pyhsxz6/bavSrnKtM=; b=nLDx6x0ucMaxzvJLJb1aqDeDXUgGUP/0fh7dvUGx/G28s0fw/mclKYpigbxE1KHuu4 NCQMG6DVGzoa9q2wrpd6yEGNMptYrDFVNCI32+2nJHZZKQgWGJ6QCor7VifajMpp5tvn K4ZOtv5HcgzwLusz3C2W9VL3WqW1O9qG4ma7f89FXssI4LDZTjrImZubBEk+mIOlesQV LdQMrUASAhvHZOVK9V0XltkwT5816TH01H6jmcjhVg39Fns2DSu36WzUuf0fCUkiBkR9 6lwcp/6kffuocZ6ND0VzvEJrkP5p2hab1+waMFxH2IIn5M595QjGJGSDG0b7cvaJB5wP bGiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ec9-20020a0564020d4900b004281287fcc4si5533146edb.39.2022.05.12.06.43.43; Thu, 12 May 2022 06:44:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352991AbiELLMt (ORCPT + 99 others); Thu, 12 May 2022 07:12:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352988AbiELLMp (ORCPT ); Thu, 12 May 2022 07:12:45 -0400 Received: from out30-45.freemail.mail.aliyun.com (out30-45.freemail.mail.aliyun.com [115.124.30.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBED7527EC; Thu, 12 May 2022 04:12:42 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R841e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VD-YkUJ_1652353959; Received: from 30.39.157.75(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VD-YkUJ_1652353959) by smtp.aliyun-inc.com(127.0.0.1); Thu, 12 May 2022 19:12:40 +0800 Message-ID: <188f7cb2-ba21-a53a-828d-7242b17b0c72@linux.alibaba.com> Date: Thu, 12 May 2022 19:13:18 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: linux-next: build failure after merge of the mm tree To: Catalin Marinas , Stephen Rothwell Cc: Andrew Morton , Will Deacon , Anshuman Khandual , Linux Kernel Mailing List , Linux Next Mailing List References: <20220512193855.4f6ce32f@canb.auug.org.au> From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 On 5/12/2022 7:07 PM, Catalin Marinas wrote: > 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; > } Yes, after checking this fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()"), I also realized it will miss TLB flush. So I am not sure I need send a incremental patch to fix this issue? Or resend my patch set [1] with rebasing on the arm64 changes? Catalin and Andrew, how do you think? Thanks. [1] https://lore.kernel.org/all/cover.1652270205.git.baolin.wang@linux.alibaba.com/