Re: [PATCH v9 5/7] mm: Make alloc_contig_range handle free hugetlb pages

2021-04-16 Thread Oscar Salvador
On Fri, Apr 16, 2021 at 05:49:20PM +0800, Baoquan He wrote: > On 04/16/21 at 09:00am, Oscar Salvador wrote: > ... > > +/* > > + * alloc_and_dissolve_huge_page - Allocate a new page and dissolve the old > > one > > + * @h: struct hstate old page belongs to > > + * @old_page: Old page to dissolve

Re: [PATCH v9 5/7] mm: Make alloc_contig_range handle free hugetlb pages

2021-04-16 Thread Baoquan He
On 04/16/21 at 09:00am, Oscar Salvador wrote: ... > +/* > + * alloc_and_dissolve_huge_page - Allocate a new page and dissolve the old > one > + * @h: struct hstate old page belongs to > + * @old_page: Old page to dissolve > + * Returns 0 on success, otherwise negated error. > + */ > +static int

[PATCH v9 5/7] mm: Make alloc_contig_range handle free hugetlb pages

2021-04-16 Thread Oscar Salvador
alloc_contig_range will fail if it ever sees a HugeTLB page within the range we are trying to allocate, even when that page is free and can be easily reallocated. This has proved to be problematic for some users of alloc_contic_range, e.g: CMA and virtio-mem, where those would fail the call even wh