[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <32726f82-e044-25e3-fdbf-ba3630da5053@suse.cz>
Date: Tue, 17 Oct 2017 19:44:44 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Guy Shattah <sguy@...lanox.com>,
Michal Nazarewicz <mina86@...a86.com>,
Michal Hocko <mhocko@...nel.org>
Cc: Christopher Lameter <cl@...ux.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-api@...r.kernel.org" <linux-api@...r.kernel.org>,
Marek Szyprowski <m.szyprowski@...sung.com>,
"Aneesh Kumar K . V" <aneesh.kumar@...ux.vnet.ibm.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Anshuman Khandual <khandual@...ux.vnet.ibm.com>,
Laura Abbott <labbott@...hat.com>
Subject: Re: [RFC PATCH 3/3] mm/map_contig: Add mmap(MAP_CONTIG) support
On 10/17/2017 04:20 PM, Guy Shattah wrote:
>
>
>> On Tue, Oct 17 2017, Guy Shattah wrote:
>>> Are you going to be OK with kernel API which implements contiguous
>>> memory allocation? Possibly with mmap style? Many drivers could
>>> utilize it instead of having their own weird and possibly non-standard
>>> way to allocate contiguous memory. Such API won't be available for
>>> user space.
>>
>> What you describe sounds like CMA. It may be far from perfect but it’s there
>> already and drivers which need contiguous memory can allocate it.
>>
>
> 1. CMA has to preconfigured. We're suggesting mechanism that works 'out of the box'
> 2. Due to the pre-allocation techniques CMA imposes limitation on maximum
> allocated memory. RDMA users often require 1Gb or more, sometimes more.
> 3. CMA reserves memory in advance, our suggestion is using existing kernel memory
> mechanisms (THP for example) to allocate memory.
You can already use THP, right? madvise(MADV_HUGEPAGE) increases your
chances to get the huge pages. Then you can mlock() them if you want.
And you get the TLB benefits. There's no guarantee of course, but you
shouldn't require a guarantee for MMAP_CONTIG anyway, because it's for
performance reasons, not functionality. So either MMAP_CONTIG would have
to fallback itself, or the userspace caller. Or would your scenario
rather fail than perform suboptimally?
> Guy
>
>
Powered by blists - more mailing lists