public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Gavin Shan <gshan@redhat.com>, torvalds@linux-foundation.org
Cc: catalin.marinas@arm.com, will@kernel.org,
	akpm@linux-foundation.org, anshuman.khandual@arm.com,
	naresh.kamboju@linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64/hugetlb: Fix building errors in huge_ptep_clear_flush()
Date: Fri, 27 May 2022 16:42:12 +0800	[thread overview]
Message-ID: <a7322d0d-ea60-d2e5-4ac2-df0077b25671@linux.alibaba.com> (raw)
In-Reply-To: <4707e621-c167-8fff-b210-9babb6a3f2df@redhat.com>



On 5/27/2022 3:12 PM, Gavin Shan wrote:
> Hi Baolin,
> 
> On 5/27/22 12:51 PM, Baolin Wang wrote:
>> Fix below building errors which was caused by commit ae07562909f3
>> ("mm: change huge_ptep_clear_flush() to return the original pte")
>> interacting with commit fb396bb459c1 ("arm64/hugetlb: Drop TLB flush
>> from get_clear_flush()").
>>
>> Due to the new get_clear_contig() has dropped TLB flush, we should
>> add an explicit TLB flush in huge_ptep_clear_flush() to keep original
>> semantics when changing to use new get_clear_contig().
>>
>> "
>> arch/arm64/mm/hugetlbpage.c: In function ‘huge_ptep_clear_flush’:
>> arch/arm64/mm/hugetlbpage.c:515:9: error: implicit declaration of
>> function ‘get_clear_flush’; did you mean ‘ptep_clear_flush’?
>> [-Werror=implicit-function-declaration]
>>    515 |  return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, 
>> ncontig);
>>        |         ^~~~~~~~~~~~~~~
>>        |         ptep_clear_flush
>> "
>>
>> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
>> Suggested-by: Catalin Marinas <catalin.marinas@arm.com>
>> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
>> Cc: Catalin Marinas <catalin.marinas@arm.com>
>> Cc: Anshuman Khandual <anshuman.khandual@arm.com>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> ---
>>   arch/arm64/mm/hugetlbpage.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
> 
> I ran to the compiling failure either and it would be caused by
> commit fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from 
> get_clear_flush()").
> It's worthy to have a "Fixes" tag. With those fixed:

Thanks for reminding. IMHO, better to add 2 related commits' fix tag. 
Linus, could you help to add them when applying this patch, or need a 
resend? Thanks.

Fixes: ae07562909f3 ("mm: change huge_ptep_clear_flush() to return the 
original pte")
Fixes: fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from 
get_clear_flush()").

> 
> Reviewed-by: Gavin Shan <gshan@redhat.com>
> 
> 
>> diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
>> index 0f0c17dfeb9c..e2a5ec9fdc0d 100644
>> --- a/arch/arm64/mm/hugetlbpage.c
>> +++ b/arch/arm64/mm/hugetlbpage.c
>> @@ -507,12 +507,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_flush(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)
>>
> 
> Thanks,
> Gavin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-05-27  8:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27  4:51 [PATCH] arm64/hugetlb: Fix building errors in huge_ptep_clear_flush() Baolin Wang
2022-05-27  7:12 ` Gavin Shan
2022-05-27  8:42   ` Baolin Wang [this message]
2022-05-27  8:55     ` Anshuman Khandual
2022-05-27  9:09 ` Naresh Kamboju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a7322d0d-ea60-d2e5-4ac2-df0077b25671@linux.alibaba.com \
    --to=baolin.wang@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=gshan@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naresh.kamboju@linaro.org \
    --cc=torvalds@linux-foundation.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox