LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Christoph Raisch <RAISCH@de.ibm.com>
To: Roland Dreier <rdreier@cisco.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	Hoang-Nam Nguyen <hnguyen@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
	openfabrics-ewg@openib.org, openib-general@openib.org
Subject: Re: [PATCH/RFC 2.6.21 2/5] ehca: ehca_uverbs.c: "proper" use of mmap
Date: Fri, 12 Jan 2007 13:25:31 +0100	[thread overview]
Message-ID: <OFF6353D7D.25679E15-ONC1257261.00429991-C1257261.0044415A@de.ibm.com> (raw)
In-Reply-To: <adaslehibjh.fsf@cisco.com>


Roland Dreier wrote on 11.01.2007 20:54:58:

>  > >  int ehca_mmap(struct ib_ucontext *context, struct vm_area_struct
*vma)
>  > >  {
>  >
>  > Can you split this monster routine into individual functions for
>  > each type of mmap please?  With two helpers to get and verify the
cq/qp
>  > shared by the individual sub-variants, that would also help to get rid
>  > of all those magic offsets.
>  >
>  > Actually, this routine directly comes from ib_device.mmap - Roland,
>  > can you shed some light on what's going on here?
>
> Each userspace-accessible IB device gets a single device node like
> /dev/infiniband/uverbsX.  Opening that gives userspace a "context".
> One of the things userspace can do with that fd is mmap() on it --
> that was originally envisioned as a way to map a page of hardware
> registers directly in to the userspace process.
>
> It seems ehca needs to allocate lots of different things in the kernel
> via mmap().  What you're saying I guess is that ideally each of these
> would be mmap() on a different fd rather than using different
> offsets.  It's a little awkward to open multiple device nodes to get
> multiple fds, since there's not a good way to attach them all to the
> same context.  I guess we could create some hack to return more file
> handles, but I think that cure is worse than the disease of using
> magic offsets...
>
> Maybe longer term we need to look at a scheme like cell's spufs but
> I'm still not confident we have the RDMA interface quite ready to
> freeze at the system call level.
>
>  - R.

...as Roland mentions, we're not completely free to change the filehandle
usage,
it's shared by ~5 drivers now.

I'd say lets investigate the direction of an own filesystem unless
there's no other clean solution.
We can polish the current version a bit, but that won't change the "magic
offsets".

Roland, could you take this patchset into your tree?
We hope it adresses the major security concern and vm_insert_page.

We're preparing the next patch for the yield deadlock topic with this
patchset as prereq.

Gruss / Regards . . . Christoph Raisch


      reply	other threads:[~2007-01-12 12:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-11 19:08 Hoang-Nam Nguyen
2007-01-11 19:40 ` Christoph Hellwig
2007-01-11 19:54   ` Roland Dreier
2007-01-12 12:25     ` Christoph Raisch [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=OFF6353D7D.25679E15-ONC1257261.00429991-C1257261.0044415A@de.ibm.com \
    --to=raisch@de.ibm.com \
    --cc=hch@infradead.org \
    --cc=hnguyen@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=openfabrics-ewg@openib.org \
    --cc=openib-general@openib.org \
    --cc=rdreier@cisco.com \
    --subject='Re: [PATCH/RFC 2.6.21 2/5] ehca: ehca_uverbs.c: "proper" use of mmap' \
    /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

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).