All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Tom Tucker <tom-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
Cc: Ralph Campbell
	<ralph.campbell-h88ZbnxC6KDQT0dZR+AlfA@public.gmane.org>,
	Tom Tucker <tom-/Yg/VP3ZvrM@public.gmane.org>,
	"rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org"
	<rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"brandt-4OHPYypu0djtX7QSmKvirg@public.gmane.org"
	<brandt-4OHPYypu0djtX7QSmKvirg@public.gmane.org>,
	"swise-/Yg/VP3ZvrM@public.gmane.org"
	<swise-/Yg/VP3ZvrM@public.gmane.org>
Subject: Re: [RFC PATCH 2/4] uverbs: Add common ib_iomem_get service
Date: Thu, 29 Jul 2010 14:41:50 -0600	[thread overview]
Message-ID: <20100729204150.GC7920@obsidianresearch.com> (raw)
In-Reply-To: <4C51E4B1.6040800-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>

On Thu, Jul 29, 2010 at 03:29:37PM -0500, Tom Tucker wrote:

>> Also, I'd like to see a strong defence of this new user space API
>> particularly:
>>   1) Why can't this be done with the existing ibv_reg_mr, like huge
>>      pages are.

> The ibv_reg_mr API assumes that the memory being registered was  
> allocated in user mode and is part of the current->mm VMA. It uses  
> get_user_pages which will scoff and jeer at kernel memory.

I'm confused? What is the vaddr input then? How does userspace get
that value? Isn't it created by mmap or the like?

Ie for the PCI-E example you gave I assume the flow is that userspace
mmaps devices/pci0000:00/0000:00:XX.X/resourceX to get the IO memory
and then passes that through to ibv_reg_mr?

IMHO, ibv_reg_mr API should accept any valid vaddr available to the
process and if it bombs for certain kinds of vaddrs then it is just a
bug..

>>   2) How is it possible for userspace to know when it should use
>>      ibv_reg_mr vs ibv_reg_io_mr?

> By virtue of the device that it is mmap'ing. If I mmap my_vmstat_driver,  
> I know that the memory I am mapping is a kernel buffer.

Yah, but what if the next version of your vmstat driver changes the
kind of memory it returns?

>> On first glance, this seems like a hugely bad API to me :)

> Well hopefully now that it's purpose is revealed you will change your  
> view and we can collaboratively make it better :-)

I don't object to the idea, just to the notion that user space is
supposed to somehow know that one vaddr is different from another
vaddr and call the right API - seems impossible to use correctly to
me.

What would you have to do to implement this using scheme using
ibv_reg_mr as the entry point?

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2010-07-29 20:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-29 16:24 [RFC PATCH 0/4] ibverbs: new verbs for registering I/O memory Tom Tucker
     [not found] ` <20100729162339.14674.15788.stgit-T4OLL4TyM9aNDNWfRnPdfg@public.gmane.org>
2010-07-29 16:25   ` [RFC PATCH 1/4] ibverbs: Add new provider verb for I/O memory registration Tom Tucker
2010-07-29 16:25   ` [RFC PATCH 2/4] uverbs: Add common ib_iomem_get service Tom Tucker
     [not found]     ` <20100729162509.14674.34237.stgit-T4OLL4TyM9aNDNWfRnPdfg@public.gmane.org>
2010-07-29 18:22       ` Ralph Campbell
     [not found]         ` <1280427723.6820.56.camel-/vjeY7uYZjrPXfVEPVhPGq6RkeBMCJyt@public.gmane.org>
2010-07-29 19:07           ` Tom Tucker
     [not found]             ` <4C51D15F.8060708-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2010-07-29 19:33               ` Ralph Campbell
2010-07-29 20:13               ` Jason Gunthorpe
     [not found]                 ` <20100729201317.GA7920-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2010-07-29 20:29                   ` Tom Tucker
     [not found]                     ` <4C51E4B1.6040800-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2010-07-29 20:41                       ` Jason Gunthorpe [this message]
     [not found]                         ` <20100729204150.GC7920-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2010-07-29 20:54                           ` Tom Tucker
2010-07-29 22:49                           ` [Suspected SPAM] " Ralph Campbell
     [not found]                             ` <1280443789.6820.153.camel-/vjeY7uYZjrPXfVEPVhPGq6RkeBMCJyt@public.gmane.org>
2010-07-29 22:57                               ` Jason Gunthorpe
     [not found]                                 ` <20100729225705.GC26390-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2010-07-29 23:13                                   ` Ralph Campbell
2010-07-30  2:16                                   ` Tom Tucker
2010-07-29 21:20       ` Tom Tucker
2010-07-29 16:25   ` [RFC PATCH 3/4] uverbs_cmd: Add uverbs command definitions for reg_io_mr Tom Tucker
2010-07-29 16:25   ` [RFC PATCH 4/4] mthca: Add support for reg_io_mr and unreg_io_mr Tom Tucker

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=20100729204150.GC7920@obsidianresearch.com \
    --to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
    --cc=brandt-4OHPYypu0djtX7QSmKvirg@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=ralph.campbell-h88ZbnxC6KDQT0dZR+AlfA@public.gmane.org \
    --cc=rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
    --cc=swise-/Yg/VP3ZvrM@public.gmane.org \
    --cc=tom-/Yg/VP3ZvrM@public.gmane.org \
    --cc=tom-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.