lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 16 Oct 2019 12:41:44 +0200
From:   David Hildenbrand <david@...hat.com>
To:     Anshuman Khandual <anshuman.khandual@....com>,
        Michal Hocko <mhocko@...nel.org>
Cc:     linux-mm@...ck.org, Mike Kravetz <mike.kravetz@...cle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Vlastimil Babka <vbabka@...e.cz>,
        David Rientjes <rientjes@...gle.com>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Oscar Salvador <osalvador@...e.de>,
        Mel Gorman <mgorman@...hsingularity.net>,
        Mike Rapoport <rppt@...ux.ibm.com>,
        Dan Williams <dan.j.williams@...el.com>,
        Pavel Tatashin <pavel.tatashin@...rosoft.com>,
        Matthew Wilcox <willy@...radead.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/page_alloc: Make alloc_gigantic_page() available for
 general use

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@...cle.com>
>>> Cc: Andrew Morton <akpm@...ux-foundation.org>
>>> Cc: Vlastimil Babka <vbabka@...e.cz>
>>> Cc: Michal Hocko <mhocko@...e.com>
>>> Cc: David Rientjes <rientjes@...gle.com>
>>> Cc: Andrea Arcangeli <aarcange@...hat.com>
>>> Cc: Oscar Salvador <osalvador@...e.de>
>>> Cc: Mel Gorman <mgorman@...hsingularity.net>
>>> Cc: Mike Rapoport <rppt@...ux.ibm.com>
>>> Cc: Dan Williams <dan.j.williams@...el.com>
>>> Cc: Pavel Tatashin <pavel.tatashin@...rosoft.com>
>>> Cc: Matthew Wilcox <willy@...radead.org>
>>> Cc: David Hildenbrand <david@...hat.com>
>>> Cc: linux-kernel@...r.kernel.org
>>> Signed-off-by: Anshuman Khandual <anshuman.khandual@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ