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

2021-03-04 Thread Oscar Salvador
On Thu, Mar 04, 2021 at 11:32:29AM +0100, David Hildenbrand wrote: > I think this is now the second fatal error we can have (-EINTR, -ENOMEM), > thus the current interface (return "NULL" on fatal errros) no longer works > properly. > > No strong opinion about fixing this up on top - could be it's

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

2021-03-04 Thread David Hildenbrand
I think we should not swallo such return values in isolate_or_dissolve_huge_page() and instead properly report esp. -ENOMEM properly up this callchain now. Otherwise we'll end up retrying / reporting -EBUSY, which is misleading. I am not sure I follow you here. So, atm, alloc_and_dissolve_huge_p

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

2021-03-04 Thread Oscar Salvador
On Mon, Mar 01, 2021 at 03:09:06PM +0100, David Hildenbrand wrote: > On 22.02.21 14:51, Oscar Salvador wrote: > > @@ -905,6 +905,18 @@ isolate_migratepages_block(struct compact_control *cc, > > unsigned long low_pfn, > > valid_page = page; > > } > > + if (

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

2021-03-01 Thread David Hildenbrand
On 22.02.21 14:51, Oscar Salvador wrote: 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-m

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

2021-02-26 Thread Michal Hocko
On Fri 26-02-21 10:45:14, Oscar Salvador wrote: > On Fri, Feb 26, 2021 at 09:35:09AM +0100, Michal Hocko wrote: > > I think it would be helpful to call out that specific case explicitly > > here. I can see only one scenario (are there more?) > > __free_huge_page() isolate_or_dissolve_huge_

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

2021-02-26 Thread Oscar Salvador
On Thu, Feb 25, 2021 at 12:03:18PM -0800, Mike Kravetz wrote: > Thanks Oscar, > > I spent a bunch of time looking for possible race issues. Thankfully, > the recent code from Muchun dealing with free lists helps. In addition, > all the hugetlb acounting looks good. > > Reviewed-by: Mike Kravetz

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

2021-02-26 Thread Oscar Salvador
On Fri, Feb 26, 2021 at 10:25:46AM +0100, David Hildenbrand wrote: > I‘m planning on giving both patches a churn early next week, with > > a) free huge pages > b) idle allocated huge pages > c) heavily read huge pages > > (Them I‘m also planning on having another brief look at the patches :) ) T

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

2021-02-26 Thread Oscar Salvador
On Fri, Feb 26, 2021 at 09:35:09AM +0100, Michal Hocko wrote: > I think it would be helpful to call out that specific case explicitly > here. I can see only one scenario (are there more?) > __free_huge_page()isolate_or_dissolve_huge_page > PageHuge() == T

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

2021-02-26 Thread David Hildenbrand
> Am 26.02.2021 um 09:38 schrieb Michal Hocko : > > On Fri 26-02-21 09:35:10, Michal Hocko wrote: >>> On Mon 22-02-21 14:51:36, Oscar Salvador wrote: >>> 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 c

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

2021-02-26 Thread Michal Hocko
On Fri 26-02-21 09:35:10, Michal Hocko wrote: > On Mon 22-02-21 14:51:36, Oscar Salvador wrote: > > 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 pr

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

2021-02-26 Thread Michal Hocko
On Mon 22-02-21 14:51:36, Oscar Salvador wrote: > 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: C

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

2021-02-25 Thread Mike Kravetz
On 2/22/21 5:51 AM, Oscar Salvador wrote: > 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

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

2021-02-22 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