Re: [PATCH 1/2] mm: Make alloc_contig_range handle free hugetlb pages

From: Oscar Salvador
Date: Thu Feb 18 2021 - 13:54:12 EST


On 2021-02-18 14:59, Michal Hocko wrote:
As I've said. Page allocator can cope with NULL nodemask just fine.
I have checked the code and now remember the tricky part. It is
alloc_gigantic_page which cannot work with NULL nodemask because it
relies on for_each_node_mask and that, unlike zonelist iterator, cannot
cope with NULL node mask. This is the case only for !GFP_THISNODE.

Ok, thanks for the clarification.

OK, I see the problem now. And your above solution is not really
optimal either. Your put_page would add the page to the pool and so it
could be used by somebody. One

Yeah, that is right.

way around it would be either directly
manipulating reference count which is fugly or you can make it a
temporal page (alloc_migrate_huge_page) or maybe even better not special
case this here but rather allow migrating free hugetlb pages in the
migrate_page path.

I will have a look into it to see how what would look.

Thanks for the feedback

--
Oscar Salvador
SUSE L3