linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>,
	Michal Hocko <mhocko@kernel.org>
Cc: linux-mm@kvack.org, Mike Kravetz <mike.kravetz@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	David Rientjes <rientjes@google.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Oscar Salvador <osalvador@suse.de>,
	Mel Gorman <mgorman@techsingularity.net>,
	Mike Rapoport <rppt@linux.ibm.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Pavel Tatashin <pavel.tatashin@microsoft.com>,
	Matthew Wilcox <willy@infradead.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/page_alloc: Make alloc_gigantic_page() available for general use
Date: Wed, 16 Oct 2019 12:41:44 +0200	[thread overview]
Message-ID: <77d835fd-91e7-4405-d252-26f565b0f1a1@redhat.com> (raw)
In-Reply-To: <c344224c-e8ae-ccea-911b-2d08f257b6f4@arm.com>

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
>>> range before trying to allocate it with alloc_contig_range(). Other than
>>> deriving the requested order from 'struct hstate', there is nothing HugeTLB
>>> specific in there. This can be made available for general use to allocate
>>> contiguous memory which could not have been allocated through the buddy
>>> allocator.
>>>
>>> alloc_gigantic_page() has been split carving out actual allocation method
>>> which is then made available via new alloc_contig_pages() helper wrapped
>>> under CONFIG_CONTIG_ALLOC. All references to 'gigantic' have been replaced
>>> with more generic term 'contig'. Allocated pages here should be freed with
>>> free_contig_range() or by calling __free_page() on each allocated page.
>>
>> Do we want to export this to modules? Apart from mostly styling issues
>> pointed by David this looks fine.
>>
>> I do agree that a general allocator api belongs to page_alloc.c rather
>> than force people to invent their own and broken instances.
>>   
>>> Cc: Mike Kravetz <mike.kravetz@oracle.com>
>>> Cc: Andrew Morton <akpm@linux-foundation.org>
>>> Cc: Vlastimil Babka <vbabka@suse.cz>
>>> Cc: Michal Hocko <mhocko@suse.com>
>>> Cc: David Rientjes <rientjes@google.com>
>>> Cc: Andrea Arcangeli <aarcange@redhat.com>
>>> Cc: Oscar Salvador <osalvador@suse.de>
>>> Cc: Mel Gorman <mgorman@techsingularity.net>
>>> Cc: Mike Rapoport <rppt@linux.ibm.com>
>>> Cc: Dan Williams <dan.j.williams@intel.com>
>>> Cc: Pavel Tatashin <pavel.tatashin@microsoft.com>
>>> Cc: Matthew Wilcox <willy@infradead.org>
>>> Cc: David Hildenbrand <david@redhat.com>
>>> Cc: linux-kernel@vger.kernel.org
>>> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
>>
>> 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 remain the same like before ?
> 

Fine with me. Please do think about the alignment thingy. (I suggest to 
just enforce an alignment to a power of two for now (and return NULL if 
not a power of two), we can always relax that when needed - and then 
think about a better search for !power of two)

-- 

Thanks,

David / dhildenb


      parent reply	other threads:[~2019-10-16 10:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-16  7:34 Anshuman Khandual
2019-10-16  8:08 ` David Hildenbrand
2019-10-16  8:40   ` David Hildenbrand
2019-10-16  8:51   ` Michal Hocko
2019-10-16  8:56     ` David Hildenbrand
2019-10-16 11:08       ` Michal Hocko
2019-10-16 11:10         ` David Hildenbrand
2019-10-16 11:49           ` Michal Hocko
2019-10-16  8:58 ` Michal Hocko
2019-10-16 10:28   ` Anshuman Khandual
2019-10-16 10:33     ` Michal Hocko
2019-10-16 10:41     ` David Hildenbrand [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=77d835fd-91e7-4405-d252-26f565b0f1a1@redhat.com \
    --to=david@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    --cc=mike.kravetz@oracle.com \
    --cc=osalvador@suse.de \
    --cc=pavel.tatashin@microsoft.com \
    --cc=rientjes@google.com \
    --cc=rppt@linux.ibm.com \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox