Re: [PATCH 21/46] hugetlb: use struct hugetlb_pte for walk_hugetlb_range

From: David Hildenbrand
Date: Mon Jan 16 2023 - 05:18:52 EST


On 12.01.23 22:33, Peter Xu wrote:
On Thu, Jan 12, 2023 at 04:17:52PM -0500, James Houghton wrote:
I'll look into it, but doing it this way will use _mapcount, so we
won't be able to use the vmemmap optimization. I think even if we do
use Hugh's approach, refcount is still being kept on the head page, so
there's still an overflow risk there (but maybe I am
misunderstanding).

Could you remind me what's the issue if using refcount on the small pages
rather than the head (assuming vmemmap still can be disabled)?

The THP-way of doing things is refcounting on the head page. All folios use a single refcount on the head.

There has to be a pretty good reason to do it differently.

--
Thanks,

David / dhildenb