lkml.org 
[lkml]   [2018]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH 03/11] x86/mm: Page size aware flush_tlb_mm_range()
From
Date
>>> --- a/arch/x86/include/asm/tlbflush.h
>>> +++ b/arch/x86/include/asm/tlbflush.h
>>> @@ -507,23 +507,25 @@ struct flush_tlb_info {
>>> unsigned long start;
>>> unsigned long end;
>>> u64 new_tlb_gen;
>>> + unsigned int invl_shift;
>>> };
>>
>> Maybe we really should just call this flush_stride or something.
>
> But its a shift, not a size. stride_shift?

Yeah, sounds better than 'invl' to me.

>>> #define local_flush_tlb() __flush_tlb()
>>>
>>> #define flush_tlb_mm(mm) flush_tlb_mm_range(mm, 0UL, TLB_FLUSH_ALL, 0UL)
>>>
>>> -#define flush_tlb_range(vma, start, end) \
>>> - flush_tlb_mm_range(vma->vm_mm, start, end, vma->vm_flags)
>>> +#define flush_tlb_range(vma, start, end) \
>>> + flush_tlb_mm_range((vma)->vm_mm, start, end, \
>>> + (vma)->vm_flags & VM_HUGETLB ? PMD_SHIFT : PAGE_SHIFT)
>>
>> This is safe. But, Couldn't this PMD_SHIFT also be PUD_SHIFT for a 1G
>> hugetlb page?
>
> It could be, but can we tell at that point?

We should have the page size via huge_page_shift(hstate_vma(vma)). No
idea if it'll work in practice, though.


\
 
 \ /
  Last update: 2018-09-13 20:48    [W:0.061 / U:29.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site