From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Alistair Popple <apopple@nvidia.com>
Cc: akpm@linux-foundation.org, shy828301@gmail.com,
ying.huang@intel.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: huge_memory: batch tlb flush when splitting a pte-mapped THP
Date: Thu, 2 Nov 2023 15:10:49 +0800 [thread overview]
Message-ID: <4978d86c-c55f-cf26-796d-237c81efeab3@linux.alibaba.com> (raw)
In-Reply-To: <877cn22e0d.fsf@nvdebian.thelocal>
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.
prev parent reply other threads:[~2023-11-02 7:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-30 1:11 Baolin Wang
2023-10-30 1:53 ` Huang, Ying
2023-10-31 18:26 ` Yang Shi
2023-11-01 6:13 ` Alistair Popple
2023-11-02 7:10 ` Baolin Wang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4978d86c-c55f-cf26-796d-237c81efeab3@linux.alibaba.com \
--to=baolin.wang@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shy828301@gmail.com \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox