linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Kravetz <mike.kravetz@oracle.com>
To: Guy Shattah <sguy@mellanox.com>, Michal Hocko <mhocko@kernel.org>,
	Christopher Lameter <cl@linux.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	linux-api@vger.kernel.org,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Michal Nazarewicz <mina86@mina86.com>,
	"Aneesh Kumar K . V" <aneesh.kumar@linux.vnet.ibm.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Anshuman Khandual <khandual@linux.vnet.ibm.com>,
	Laura Abbott <labbott@redhat.com>,
	Vlastimil Babka <vbabka@suse.cz>
Subject: Re: [RFC PATCH 3/3] mm/map_contig: Add mmap(MAP_CONTIG) support
Date: Mon, 16 Oct 2017 10:43:38 -0700	[thread overview]
Message-ID: <aff6b405-6a06-f84d-c9b1-c6fb166dff81@oracle.com> (raw)
In-Reply-To: <752b49eb-55c6-5a34-ab41-6e91dd93ea70@mellanox.com>

On 10/15/2017 12:50 AM, Guy Shattah wrote:
> On 13/10/2017 19:17, Michal Hocko wrote:
>> On Fri 13-10-17 10:56:13, Cristopher Lameter wrote:
>>> On Fri, 13 Oct 2017, Michal Hocko wrote:
>>>
>>>>> There is a generic posix interface that could we used for a variety of
>>>>> specific hardware dependent use cases.
>>>> Yes you wrote that already and my counter argument was that this generic
>>>> posix interface shouldn't bypass virtual memory abstraction.
>>> It does do that? In what way?
>> availability of the virtual address space depends on the availability of
>> the same sized contiguous physical memory range. That sounds like the
>> abstraction is gone to large part to me.
> In what way? userspace users will still be working with virtual memory.
> 
>>
>>>>> There are numerous RDMA devices that would all need the mmap
>>>>> implementation. And this covers only the needs of one subsystem. There are
>>>>> other use cases.
>>>> That doesn't prevent providing a library function which could be reused
>>>> by all those drivers. Nothing really too much different from
>>>> remap_pfn_range.
>>> And then in all the other use cases as well. It would be much easier if
>>> mmap could give you the memory you need instead of havig numerous drivers
>>> improvise on their own. This is in particular also useful
>>> for numerous embedded use cases where you need contiguous memory.
>> But a generic implementation would have to deal with many issues as
>> already mentioned. If you make this driver specific you can have access
>> control based on fd etc... I really fail to see how this is any
>> different from remap_pfn_range.
> Why have several driver specific implementation if you can generalize the idea and implement
> an already existing POSIX standard?

Just to be clear, the posix standard talks about a typed memory object.
The suggested implementation has one create a connection to the memory
object to receive a fd, then use mmap as usual to get a mapping backed
by contiguous pages/memory.  Of course, this type of implementation is
not a requirement.  However, this type of implementation looks quite a
bit like hugetlbfs today.
- Both require opening a special file/device, and then calling mmap on
  the returned fd.  You can technically use mmap(MAP_HUGETLB), but that
  still ends up using hugetbfs.  BTW, there was resistance to adding the
  MAP_HUGETLB flag to mmap.
- Allocation of contiguous memory is much like 'on demand' allocation of
  huge pages.  There are some (not many) users that use this model.  They
  attempt to allocate huge pages on demand, and if not available fall back
  to base pages.  This is how contiguous allocations would need to work.
  Of course, most hugetlbfs users pre-allocate pages for their use, and
  this 'might' be something useful for contiguous allocations as well.

I wonder if going down the path of a separate devide/filesystem/etc for
contiguous allocations might be a better option.  It would keep the
implementation somewhat separate.  However, I would then be afraid that
we end up with another 'separate/special vm' as in the case of hugetlbfs
today.

-- 
Mike Kravetz

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2017-10-16 17:43 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03 23:56 [RFC] mmap(MAP_CONTIG) Mike Kravetz
2017-10-04 11:54 ` Michal Nazarewicz
2017-10-04 17:08   ` Mike Kravetz
2017-10-04 21:29     ` Laura Abbott
2017-10-04 13:49 ` Anshuman Khandual
2017-10-04 16:05   ` Christopher Lameter
2017-10-04 17:38     ` Mike Kravetz
2017-10-04 17:35   ` Mike Kravetz
2017-10-05  7:06 ` Vlastimil Babka
2017-10-05  8:58   ` Guy Shattah
2017-10-05 12:36     ` Guy Shattah
2017-10-05 14:30   ` Christopher Lameter
2017-10-12  1:46 ` [RFC PATCH 0/3] Add mmap(MAP_CONTIG) support Mike Kravetz
2017-10-12  1:46   ` [RFC PATCH 1/3] mm/map_contig: Add VM_CONTIG flag to vma struct Mike Kravetz
2017-10-12  1:46   ` [RFC PATCH 2/3] mm/map_contig: Use pre-allocated pages for VM_CONTIG mappings Mike Kravetz
2017-10-12 11:04     ` Anshuman Khandual
2017-10-12  1:46   ` [RFC PATCH 3/3] mm/map_contig: Add mmap(MAP_CONTIG) support Mike Kravetz
2017-10-12 11:22     ` Anshuman Khandual
2017-10-13 15:14       ` Christopher Lameter
2017-10-12 14:37     ` Michal Hocko
2017-10-12 17:19       ` Mike Kravetz
2017-10-13  8:40         ` Michal Hocko
2017-10-13 15:20           ` Christopher Lameter
2017-10-13 15:28             ` Michal Hocko
2017-10-13 15:42               ` Christopher Lameter
2017-10-13 15:47                 ` Michal Hocko
     [not found]                   ` <20171013154747.2jv7rtfqyyagiodn-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2017-10-13 15:56                     ` Christopher Lameter
2017-10-13 16:17                       ` Michal Hocko
2017-10-15  7:50                         ` Guy Shattah
2017-10-16  8:24                           ` Michal Hocko
     [not found]                             ` <20171016082456.no6ux63uy2rmj4fe-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2017-10-16  9:11                               ` Guy Shattah
2017-10-16 12:32                                 ` Michal Hocko
     [not found]                                   ` <20171016123248.csntl6luxgafst6q-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2017-10-16 16:00                                     ` Christopher Lameter
2017-10-16 17:42                                       ` Michal Hocko
     [not found]                                         ` <20171016174229.pz3o4uhzz3qbrp6n-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2017-10-16 17:56                                           ` Christopher Lameter
2017-10-16 18:17                                             ` Michal Hocko
2017-10-23 15:25                                           ` David Nellans
2017-10-17 10:50                                   ` Guy Shattah
     [not found]                                     ` <AM6PR0502MB378375AF8B569DBCCFE20D7DBD4C0-md96bDB8+JV1k1TWM4Wt8cDSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-10-17 10:59                                       ` Michal Hocko
2017-10-17 13:22                                       ` Michal Nazarewicz
2017-10-17 14:20                                         ` Guy Shattah
2017-10-17 17:44                                           ` Vlastimil Babka
2017-10-17 18:23                                           ` Mike Kravetz
2017-10-17 19:56                                             ` Vlastimil Babka
     [not found]                           ` <752b49eb-55c6-5a34-ab41-6e91dd93ea70-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-10-16 10:33                             ` Michal Nazarewicz
     [not found]                               ` <xa1t60bfxtzw.fsf-deATy8a+UHjQT0dZR+AlfA@public.gmane.org>
2017-10-16 11:09                                 ` Guy Shattah
2017-10-16 17:43                           ` Mike Kravetz [this message]
     [not found]                             ` <aff6b405-6a06-f84d-c9b1-c6fb166dff81-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-10-16 18:07                               ` Michal Hocko
2017-10-16 20:32                                 ` Mike Kravetz
2017-10-16 20:58                                   ` Michal Hocko
2017-10-16 21:03                                   ` Laura Abbott
2017-10-16 21:18                                     ` Mike Kravetz
     [not found]                                   ` <e8cf6227-003d-8a82-8b4d-07176b43810c-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-10-17  6:59                                     ` Vlastimil Babka
2017-10-15  6:58                   ` Pavel Machek
2017-10-16  8:18                     ` Michal Hocko
2017-10-16  9:54                       ` Pavel Machek
2017-10-16 12:18                         ` Michal Hocko
     [not found]                           ` <20171016121808.m4sq3g5nxeyxoymc-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2017-10-16 16:02                             ` Christopher Lameter
2017-10-16 17:33                               ` Michal Hocko
2017-10-16 17:53                                 ` Christopher Lameter
2017-10-15  8:07     ` Guy Shattah
2017-10-12 10:36   ` [RFC PATCH 0/3] " Anshuman Khandual
2017-10-12 14:25     ` Anshuman Khandual
2017-10-23 22:10 ` [RFC] mmap(MAP_CONTIG) Dave Hansen
2017-10-24 22:49   ` Mike Kravetz

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=aff6b405-6a06-f84d-c9b1-c6fb166dff81@oracle.com \
    --to=mike.kravetz@oracle.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=khandual@linux.vnet.ibm.com \
    --cc=labbott@redhat.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mhocko@kernel.org \
    --cc=mina86@mina86.com \
    --cc=sguy@mellanox.com \
    --cc=vbabka@suse.cz \
    /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;
as well as URLs for NNTP newsgroup(s).