Re: [PATH v2 3/5] x86/tlb: fall back to flush all when meet a THPlarge page
From: Hillf Danton
Date: Fri May 04 2012 - 09:38:30 EST
On Fri, May 4, 2012 at 9:00 PM, Alex Shi <alex.shi@xxxxxxxxx> wrote:
> On 05/04/2012 08:11 PM, Hillf Danton wrote:
>
>> Hi Alex,
>>
>> Â Â Â Â Â Â Â Â Â Â Â if (vmflag & VM_EXEC)
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â tlb_entries = tlb_lli_4k[ENTRIES];
>> @@ -22,11 +23,15 @@ void flush_tlb_range(struct vm_area_stru
>> Â Â Â Â Â Â Â Â Â Â Â act_entries = tlb_entries > mm->total_vm ?
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â mm->total_vm : tlb_entries;
>>
>> - Â Â Â Â Â Â Â Â Â Â if ((end - start)/PAGE_SIZE > act_entries/FLUSHALL_BAR)
>> + Â Â Â Â Â Â Â Â Â Â pg_sz = (transparent_hugepage_enabled(vma) ||
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â is_vm_hugetlb_page(vma)) ?
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â HPAGE_SIZE : PAGE_SIZE;
>> +
>> + Â Â Â Â Â Â Â Â Â Â if ((end - start)/pg_sz > act_entries/FLUSHALL_BAR)
>
>
> Your patch should base on the second patch that expel the HUGETLB page.
>
The diff is only for showing idea.
> But the key fact is I did not find invlpg is help on HUGETLB.
Yep, I only assume flushing huge TLB is not far from regular TLB.
¢éì®&Þ~º&¶¬+-±éÝ¥w®Ë±Êâmébìdz¹Þ)í
æèw*jg¬±¨¶Ýj/êäz¹Þà2Þ¨èÚ&¢)ß«a¶Úþø®G«éh®æj:+v¨wèÙ>W±êÞiÛaxPjØm¶ÿÃ-»+ùd_