On 14.09.20 17:00, Michal Hocko wrote: > On Tue 08-09-20 10:30:35, David Hildenbrand wrote: > [...] >> - gigantic pages (alloc_contig_range()) never use ranges with holes >> - CMA (alloc_contig_range()) never uses ranges with holes. > > Where is that enforced? > You mean with CMA? I think the way CMA obtains regions from memblock would not allow for that. (allocating something that's not actually there does not make too much sense) For example, we do a couple of unchecked pfn_to_page() calls directly in alloc_contig_range(), most prominently right at the beginning (page_zone(pfn_to_page(start)). Also, __test_page_isolated_in_pageblock() would never succeed in case we have memory holes that have a valid memmap (PageReserved()). I think we should update the documentation of alloc_contig_range() "The PFN range must belong to a single zone and must not contain any holes." And simplify all that code. Of course, assuming there isn't a CMA use case with holes I am too blind to see. -- Thanks, David / dhildenb