All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liran Liss <liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>,
	Ahmad Omary <ahmad-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Jason Gunthorpe
	<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>,
	ahmad omary <ahmad151084-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Tzahi Oved <tzahio-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Alex Rosenbaum <alexr-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Ariel Levkovich <lariel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Subject: RE: [RFC] libibverbs IB Device Memory support
Date: Thu, 8 Jun 2017 13:10:34 +0000	[thread overview]
Message-ID: <HE1PR0501MB2812BC7D5A7824FFD77B4D75B1C90@HE1PR0501MB2812.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1706061022270.16819-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>

> From: Christoph Lameter [mailto:cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org]
> Sent: Tuesday, June 06, 2017 6:30 PM

Hi Chistoph,

> The OS needs to provide the protection if that is the case and then it probably is
> not a HPC device. We are talking about RDMA high end devices here. The design
> here is for performance and low latency. I dont know of any devices in use in
> HPC or in HFT that have these tiny memory sizes.
> Mostly these devices are already engineeded for mmapping.
> 
> Is this for some kind of embedded device?
> 

In our case, this is the HCA.
Device memory could be a scarce resource, and even allocating a 4K page per process could wasteful in some systems.
An allocation API allows allocations of any size.

> > Note that the device memory does not necessary have to be mapped to
> > the CPU= .
> > i.e. is not necessary accessible by PCI, and can only be accessed by RDMA.
> > This is why we can't use MMAP for all cases  and a dedicated
> > allocation and  copy functions are needed.
> 
> Can we come up with some sort of ioctl API then to write to the devices
> inaccessible memory? There must be other drives outside of the RDMA tree that
> have similar requirements and that may already have implemented some
> version of it.
> 
> This seems to be a very specialized application that may be device specific. ioctls
> are usually used then.

The host to dev memcopy is often a user-space only action, so ioctl() doesn't work for us.
The memcpy API allows efficient data transfer regardless of the implementation.

I also don't think that always mandating a direct mmap() is the solution.
First, not in all cases such a mapping exists.
Some devices have only limited BAR space, which can only be dynamically mapped to a small window at a time. In this case, you might need to move the window before the access.
Other device might not be able to map device memory to the CPU at all.

Even if a direct mapping is possible, you don't expose mmap()'d IO memory directly to the application.
There are details such as optimizing for write-combining, locking, and flushing that the application shouldn't be aware of.
--Liran
--
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:[~2017-06-08 13:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-10 11:25 [RFC] libibverbs IB Device Memory support ahmad omary
     [not found] ` <CADWppnpd9Up7wUTxRgSinhgx3kt3+0bKwgt6P_d3CV1oA90isQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-05 16:44   ` Christoph Lameter
     [not found]     ` <alpine.DEB.2.20.1706051141230.26831-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2017-06-05 17:08       ` Leon Romanovsky
     [not found]         ` <20170605170825.GP6868-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-06-05 17:17           ` Jason Gunthorpe
     [not found]             ` <20170605171749.GA20477-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-06-05 17:41               ` Leon Romanovsky
     [not found]                 ` <20170605174151.GR6868-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-06-05 22:11                   ` Christoph Lameter
     [not found]                     ` <alpine.DEB.2.20.1706051705350.886-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2017-06-06 11:51                       ` Ahmad Omary
     [not found]                         ` <AM4PR0501MB1956B596450F3BC38806E775C4CB0-dp/nxUn679ggcKT3UpMsY8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-06-06 15:25                           ` Liran Liss
2017-06-06 15:30                           ` Christoph Lameter
     [not found]                             ` <alpine.DEB.2.20.1706061022270.16819-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2017-06-08 13:10                               ` Liran Liss [this message]
2017-06-06  7:10       ` Christoph Hellwig
2017-06-05 17:20   ` Jason Gunthorpe
     [not found]     ` <20170605172058.GB20477-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-06-06  5:52       ` Leon Romanovsky
     [not found]         ` <20170606055229.GT6868-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-06-06  6:31           ` Leon Romanovsky
2017-06-06 16:34           ` Jason Gunthorpe
2017-06-06  7:35   ` Sagi Grimberg
     [not found]     ` <46b1a06d-5936-799c-7743-097c579971ef-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
2017-06-06 16:49       ` Logan Gunthorpe

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=HE1PR0501MB2812BC7D5A7824FFD77B4D75B1C90@HE1PR0501MB2812.eurprd05.prod.outlook.com \
    --to=liranl-vpraknaxozvwk0htik3j/w@public.gmane.org \
    --cc=ahmad-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=ahmad151084-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=alexr-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org \
    --cc=hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
    --cc=lariel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tzahio-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=yishaih-VPRAkNaXOzVWk0Htik3J/w@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.