Re: [PATCH] mm/page_alloc: Make alloc_gigantic_page() available for general use

2019-10-16 Thread Michal Hocko
On Wed 16-10-19 13:10:41, David Hildenbrand wrote: > On 16.10.19 13:08, Michal Hocko wrote: > > On Wed 16-10-19 10:56:16, David Hildenbrand wrote: [...] > > > Gigantic pages have to be aligned AFAIK. > > > > Aligned to what? I do not see any guarantee like that in the existing > > code. > > > >

Re: [PATCH] mm/page_alloc: Make alloc_gigantic_page() available for general use

2019-10-16 Thread David Hildenbrand
On 16.10.19 13:08, Michal Hocko wrote: On Wed 16-10-19 10:56:16, David Hildenbrand wrote: On 16.10.19 10:51, Michal Hocko wrote: On Wed 16-10-19 10:08:21, David Hildenbrand wrote: On 16.10.19 09:34, Anshuman Khandual wrote: [...] +static bool pfn_range_valid_contig(struct zone *z, unsigned l

Re: [PATCH] mm/page_alloc: Make alloc_gigantic_page() available for general use

2019-10-16 Thread Michal Hocko
On Wed 16-10-19 10:56:16, David Hildenbrand wrote: > On 16.10.19 10:51, Michal Hocko wrote: > > On Wed 16-10-19 10:08:21, David Hildenbrand wrote: > > > On 16.10.19 09:34, Anshuman Khandual wrote: > > [...] > > > > +static bool pfn_range_valid_contig(struct zone *z, unsigned long > > > > start_pfn

Re: [PATCH] mm/page_alloc: Make alloc_gigantic_page() available for general use

2019-10-16 Thread David Hildenbrand
On 16.10.19 12:28, Anshuman Khandual wrote: On 10/16/2019 02:28 PM, Michal Hocko wrote: On Wed 16-10-19 13:04:53, Anshuman Khandual wrote: HugeTLB helper alloc_gigantic_page() implements fairly generic allocation method where it scans over various zones looking for a large contiguous pfn rang

Re: [PATCH] mm/page_alloc: Make alloc_gigantic_page() available for general use

2019-10-16 Thread Michal Hocko
On Wed 16-10-19 15:58:32, Anshuman Khandual wrote: > > > On 10/16/2019 02:28 PM, Michal Hocko wrote: [...] > > After other issues mentioned by David get resolved you can add > > Just to confirm. Only the styling issues, right ? pfn_range_valid_contig(), > pfn alignment and zone scanning all rema

Re: [PATCH] mm/page_alloc: Make alloc_gigantic_page() available for general use

2019-10-16 Thread Anshuman Khandual
On 10/16/2019 02:28 PM, Michal Hocko wrote: > On Wed 16-10-19 13:04:53, Anshuman Khandual wrote: >> HugeTLB helper alloc_gigantic_page() implements fairly generic allocation >> method where it scans over various zones looking for a large contiguous pfn >> range before trying to allocate it with

Re: [PATCH] mm/page_alloc: Make alloc_gigantic_page() available for general use

2019-10-16 Thread Michal Hocko
On Wed 16-10-19 13:04:53, Anshuman Khandual wrote: > HugeTLB helper alloc_gigantic_page() implements fairly generic allocation > method where it scans over various zones looking for a large contiguous pfn > range before trying to allocate it with alloc_contig_range(). Other than > deriving the requ

Re: [PATCH] mm/page_alloc: Make alloc_gigantic_page() available for general use

2019-10-16 Thread David Hildenbrand
On 16.10.19 10:51, Michal Hocko wrote: On Wed 16-10-19 10:08:21, David Hildenbrand wrote: On 16.10.19 09:34, Anshuman Khandual wrote: [...] +static bool pfn_range_valid_contig(struct zone *z, unsigned long start_pfn, + unsigned long nr_pages) +{ + unsigne

Re: [PATCH] mm/page_alloc: Make alloc_gigantic_page() available for general use

2019-10-16 Thread Michal Hocko
On Wed 16-10-19 10:08:21, David Hildenbrand wrote: > On 16.10.19 09:34, Anshuman Khandual wrote: [...] > > +static bool pfn_range_valid_contig(struct zone *z, unsigned long start_pfn, > > + unsigned long nr_pages) > > +{ > > + unsigned long i, end_pfn = start_pfn + nr

Re: [PATCH] mm/page_alloc: Make alloc_gigantic_page() available for general use

2019-10-16 Thread David Hildenbrand
On 16.10.19 10:08, David Hildenbrand wrote: On 16.10.19 09:34, Anshuman Khandual wrote: HugeTLB helper alloc_gigantic_page() implements fairly generic allocation method where it scans over various zones looking for a large contiguous pfn range before trying to allocate it with alloc_contig_range

Re: [PATCH] mm/page_alloc: Make alloc_gigantic_page() available for general use

2019-10-16 Thread David Hildenbrand
On 16.10.19 09:34, Anshuman Khandual wrote: HugeTLB helper alloc_gigantic_page() implements fairly generic allocation method where it scans over various zones looking for a large contiguous pfn range before trying to allocate it with alloc_contig_range(). Other than deriving the requested order f

[PATCH] mm/page_alloc: Make alloc_gigantic_page() available for general use

2019-10-16 Thread Anshuman Khandual
HugeTLB helper alloc_gigantic_page() implements fairly generic allocation method where it scans over various zones looking for a large contiguous pfn range before trying to allocate it with alloc_contig_range(). Other than deriving the requested order from 'struct hstate', there is nothing HugeTLB