lkml.org 
[lkml]   [2023]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] mm: huge_memory: batch tlb flush when splitting a pte-mapped THP
From


On 11/1/2023 2:13 PM, Alistair Popple wrote:
>
> Baolin Wang <baolin.wang@linux.alibaba.com> writes:
>
>> I can observe an obvious tlb flush hotpot when splitting a pte-mapped THP on
>
> A tlb flush hotpot does sound delicious, but I think you meant hotspot :-)

Ah, yes. Hope Andrew can help to fix it :)

>> my ARM64 server, and the distribution of this hotspot is as follows:
>>
>> - 16.85% split_huge_page_to_list
>> + 7.80% down_write
>> - 7.49% try_to_migrate
>> - 7.48% rmap_walk_anon
>> 7.23% ptep_clear_flush
>> + 1.52% __split_huge_page
>>
>> The reason is that the split_huge_page_to_list() will build migration entries
>> for each subpage of a pte-mapped Anon THP by try_to_migrate(), or unmap for
>> file THP, and it will clear and tlb flush for each subpage's pte. Moreover,
>> the split_huge_page_to_list() will set TTU_SPLIT_HUGE_PMD flag to ensure
>> the THP is already a pte-mapped THP before splitting it to some normal pages.
>
> The only other user of TTU_SPLIT_HUGE_PMD is vmscan which also sets
> TTU_BATCH_FLUSH so we could make the former imply the latter but that
> seem dangerous given the requirement to call try_to_unmap_flush() so
> best not to.
>
> Reviewed-by: Alistair Popple <apopple@nvidia.com>

Thanks for reviewing, and also thanks to Ying and Yang.

\
 
 \ /
  Last update: 2023-11-02 08:11    [W:0.089 / U:1.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site