Re: [PATCH] mm: hugetlb: kill set_huge_swap_pte_at()

From: Matthew Wilcox
Date: Mon Jun 27 2022 - 10:34:52 EST


On Mon, Jun 27, 2022 at 01:05:00PM +0530, Anshuman Khandual wrote:
> > For the swap entry of hugetlb, we need to remember that we should
> > call set_huge_swap_pte_at() instead of set_huge_pte_at() every
>
> Which is intuitive, so what is the problem ?

The problem is that HugeTLB is DIFFERENT from the rest of the VM.
This has a huge cost in programmer time, which is infinitely more
valuable than the cycle shaving you're quibbling over. We should take
any and every opportunity to make huge pages work the same way as THP
and order-0 pages.