[PATCH] powerpc/mm/hugetlb: Use the correct page size when flushing hugepage tlb

Aneesh Kumar K.V aneesh.kumar at linux.ibm.com
Tue May 29 12:38:51 AEST 2018


On 05/29/2018 07:39 AM, Nicholas Piggin wrote:
> On Tue, 29 May 2018 11:33:56 +1000
> Michael Ellerman <mpe at ellerman.id.au> wrote:
> 
>> "Aneesh Kumar K.V" <aneesh.kumar at linux.ibm.com> writes:
>>
>>> We used wrong page size (mmu_virtual_psize) when doing a tlbflush after
>>> pte update. This patch update the flush to use hugetlb page size.
>>> The page size is derived from hugetlb hstate.
>>
>> This sounds bad. Or is it not for some reason?
> 
> It's not all that bad because the flush is mostly superfluous (one of
> my tlbie optimisation patches gets rid of it except for accelerators).
> 
>>
>> Either way a Fixes tag would be nice. Maybe:
>>
>>    Fixes: b3603e174fc8 ("powerpc/mm: update radix__ptep_set_access_flag to not do full mm tlb flush")
>>
>> I think this is only a problem on Radix, but the change log doesn't say.
> 
> huge_ptep_set_access_flags->ptep_set_access_flags->flush_tlb_page->
> 
> void radix__flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
> {
> #ifdef CONFIG_HUGETLB_PAGE
>          if (is_vm_hugetlb_page(vma))
>                  return radix__flush_hugetlb_page(vma, vmaddr);
> #endif
>          radix__flush_tlb_page_psize(vma->vm_mm, vmaddr, mmu_virtual_psize);
> }
> 
> So I'm still not sure how the size is going wrong here. What am I
> missig?
> 

My mistake, I didn't look at the radix expansion. I was looking at 
huge_ptep_clear_flush() where we use flush_hugetlb_page().

-aneesh



More information about the Linuxppc-dev mailing list