lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4978d86c-c55f-cf26-796d-237c81efeab3@linux.alibaba.com>
Date:   Thu, 2 Nov 2023 15:10:49 +0800
From:   Baolin Wang <baolin.wang@...ux.alibaba.com>
To:     Alistair Popple <apopple@...dia.com>
Cc:     akpm@...ux-foundation.org, shy828301@...il.com,
        ying.huang@...el.com, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: huge_memory: batch tlb flush when splitting a
 pte-mapped THP



On 11/1/2023 2:13 PM, Alistair Popple wrote:
> 
> Baolin Wang <baolin.wang@...ux.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@...dia.com>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ