From: Roland Dreier <rolandd@cisco.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, openib-general@openib.org
Subject: Re: [PATCH 06/16] IB uverbs: memory pinning implementation
Date: Wed, 29 Jun 2005 09:06:18 -0700 [thread overview]
Message-ID: <524qbhgnb9.fsf@topspin.com> (raw)
In-Reply-To: 20050628170212.24623191.akpm@osdl.org
Roland> Add support for pinning userspace memory regions and
Roland> returning a list of pages in the region. This includes
Roland> tracking pinned memory against vm_locked and preventing
Roland> unprivileged users from exceeding RLIMIT_MEMLOCK.
Andrew> Can you tell us a bit more about the design ideas here?
Andrew> What's it doing, how and why?
The idea is that allowing userspace to handle initiating IO directly
requires the kernel to make sure the memory targeted by that IO is
kept pinned. This is done by requiring userspace to register the
memory regions it will use for IO in advance.
The code in uverbs_mem.c helps handle this by providing a function
ib_umem_get(), which wraps up calling get_user_pages() and
dma_map_sg() for a given piece of userspace address space, and returns
a data structure with DMA addresses for region.
Since userspace can potentially register huge chunks of memory, the
code breaks up the calls to get_user_pages() and dma_map_sg() into
chunks, and the umem data structure has a linked list of these chunks.
Andrew> We should look at these things and also decide whether
Andrew> some of this should live in mm/*.
I thought about that a little while I was writing the code. The only
thing that seemed generic enough was the logic for vm_locked
accounting and checking against RLIMIT_MEMLOCK. I wasn't smart enough
to come up with a way to encapsulate it that seemed any easier to read
or maintain than just spelling the logic out.
iWARP (basically RDMA over TCP) will also want to use the memory
pinning code here, but I think the best plan for handling iWARP is to
evolve drivers/infiniband into a more generic drivers/rdma -- in which
case, this code is fine where it is.
So... no objection to making it generic or putting it somewhere else,
but there's not anything deep going on here.
- R.
next prev parent reply other threads:[~2005-06-29 16:07 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-28 23:03 [PATCH 00/16] Add InfiniBand userspace verbs (direct userspace access) Roland Dreier
2005-06-28 23:03 ` [PATCH 01/16] IB uverbs: core API extensions Roland Dreier
2005-06-28 23:03 ` [PATCH 02/16] IB uverbs: update kernel midlayer for new API Roland Dreier
2005-06-28 23:03 ` [PATCH 03/16] IB uverbs: update mthca " Roland Dreier
2005-06-28 23:03 ` [PATCH 04/16] IB uverbs: add user verbs ABI header Roland Dreier
2005-06-28 23:03 ` [PATCH 05/16] IB uverbs: core implementation Roland Dreier
2005-06-28 23:03 ` [PATCH 06/16] IB uverbs: memory pinning implementation Roland Dreier
2005-06-28 23:03 ` [PATCH 07/16] IB uverbs: hook up Kconfig/Makefile Roland Dreier
2005-06-28 23:03 ` [PATCH 08/16] IB uverbs: add mthca ABI header Roland Dreier
2005-06-28 23:03 ` [PATCH 09/16] IB uverbs: add mthca user doorbell record support Roland Dreier
2005-06-28 23:03 ` [PATCH 10/16] IB uverbs: add mthca user context support Roland Dreier
2005-06-28 23:03 ` [PATCH 11/16] IB uverbs: add mthca mmap support Roland Dreier
2005-06-28 23:03 ` [PATCH 12/16] IB uverbs: add mthca user PD support Roland Dreier
2005-06-28 23:03 ` [PATCH 13/16] IB uverbs: add mthca user MR support Roland Dreier
2005-06-28 23:03 ` [PATCH 14/16] IB uverbs: add mthca user CQ support Roland Dreier
2005-06-28 23:03 ` [PATCH 15/16] IB uverbs: add mthca user QP support Roland Dreier
2005-06-28 23:03 ` [PATCH 16/16] IB uverbs: add documentation file Roland Dreier
2005-06-29 0:10 ` [PATCH 14/16] IB uverbs: add mthca user CQ support Andrew Morton
2005-06-29 16:06 ` Roland Dreier
2005-06-29 0:07 ` [PATCH 12/16] IB uverbs: add mthca user PD support Andrew Morton
2005-06-29 16:06 ` Roland Dreier
2005-06-29 0:05 ` [PATCH 11/16] IB uverbs: add mthca mmap support Andrew Morton
2005-06-29 16:06 ` Roland Dreier
2005-07-05 19:20 ` Roland Dreier
2005-07-05 20:53 ` Michael S. Tsirkin
2005-07-05 22:07 ` Roland Dreier
2005-06-29 0:02 ` [PATCH 06/16] IB uverbs: memory pinning implementation Andrew Morton
2005-06-29 16:06 ` Roland Dreier [this message]
2005-06-29 0:27 ` [PATCH 05/16] IB uverbs: core implementation Greg KH
2005-06-29 1:38 ` [openib-general] " Tom Duffy
2005-06-29 4:13 ` Troy Benjegerdes
2005-06-29 16:12 ` Greg KH
2005-06-29 16:32 ` Troy Benjegerdes
2005-06-29 16:06 ` Roland Dreier
2005-06-29 17:01 ` Roland Dreier
2005-06-29 18:03 ` Greg KH
2005-06-30 3:13 ` [openib-general] " Ronald G. Minnich
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=524qbhgnb9.fsf@topspin.com \
--to=rolandd@cisco.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=openib-general@openib.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