On May 22, 2025, at 19:49, Oscar Salvador osalvador@suse.de wrote:
On Thu, May 22, 2025 at 07:34:56PM +0800, Ge Yang wrote:
It seems that we cannot simply remove the folio_test_hugetlb() check. The reasons are as follows:
Yeah, my thought was whether we could move the folio_hstate within alloc_and_dissolve_hugetlb_folio(), since the latter really needs to take the lock. But isolate_or_dissolve_huge_page() also needs the 'hstate' not only to pass it onto alloc_and_dissolve_hugetlb_folio() but to check whether hstate is gigantic.
But I think we could use "folio_order() > MAX_PAGE_ORDER" to replace the check of hstate_is_gigantic(), right? Then ee could remove the first parameter of hstate from alloc_and_dissolve_hugetlb_folio() and obtain hstate in it.
Umh, kinda hate sparkling the locks all around.
-- Oscar Salvador SUSE Labs