Re: [PATCH v5 4/5] mm: Make alloc_contig_range handle in-use hugetlb pages

2021-03-18 Thread Michal Hocko
On Thu 18-03-21 10:59:10, Oscar Salvador wrote: > On Thu, Mar 18, 2021 at 10:29:57AM +0100, Michal Hocko wrote: > > On Thu 18-03-21 09:54:01, Oscar Salvador wrote: > > [...] > > > @@ -2287,10 +2288,12 @@ static int alloc_and_dissolve_huge_page(struct > > > hstate *h, struct page *old_page) > > >

Re: [PATCH v5 4/5] mm: Make alloc_contig_range handle in-use hugetlb pages

2021-03-18 Thread Oscar Salvador
On Thu, Mar 18, 2021 at 10:29:57AM +0100, Michal Hocko wrote: > On Thu 18-03-21 09:54:01, Oscar Salvador wrote: > [...] > > @@ -2287,10 +2288,12 @@ static int alloc_and_dissolve_huge_page(struct > > hstate *h, struct page *old_page) > > goto unlock; > > } else if (page_count(old_pa

Re: [PATCH v5 4/5] mm: Make alloc_contig_range handle in-use hugetlb pages

2021-03-18 Thread Michal Hocko
On Thu 18-03-21 09:54:01, Oscar Salvador wrote: [...] > @@ -2287,10 +2288,12 @@ static int alloc_and_dissolve_huge_page(struct hstate > *h, struct page *old_page) > goto unlock; > } else if (page_count(old_page)) { > /* > - * Someone has grabbed the p

Re: [PATCH v5 4/5] mm: Make alloc_contig_range handle in-use hugetlb pages

2021-03-18 Thread Oscar Salvador
On Wed, Mar 17, 2021 at 03:26:50PM +0100, Michal Hocko wrote: > it would be imho better to retry inside alloc_and_dissolve_huge_page > because it already has its retry logic implemented. > > But not something I will insist on. Ok, what about this (I did not even compile it yet, but gives a rough

Re: [PATCH v5 4/5] mm: Make alloc_contig_range handle in-use hugetlb pages

2021-03-17 Thread Michal Hocko
On Wed 17-03-21 12:12:50, Oscar Salvador wrote: > alloc_contig_range() will fail if it finds a HugeTLB page within the range, > without a chance to handle them. Since HugeTLB pages can be migrated as any > LRU or Movable page, it does not make sense to bail out without trying. > Enable the interfac

[PATCH v5 4/5] mm: Make alloc_contig_range handle in-use hugetlb pages

2021-03-17 Thread Oscar Salvador
alloc_contig_range() will fail if it finds a HugeTLB page within the range, without a chance to handle them. Since HugeTLB pages can be migrated as any LRU or Movable page, it does not make sense to bail out without trying. Enable the interface to recognize in-use HugeTLB pages so we can migrate th