linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Deucher, Alexander" <Alexander.Deucher@amd.com>
To: "'Haggai Eran'" <haggaie@mellanox.com>,
	Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"linux-nvdimm@ml01.01.org" <linux-nvdimm@ml01.01.org>,
	"Koenig, Christian" <Christian.Koenig@amd.com>,
	"Suthikulpanit, Suravee" <Suravee.Suthikulpanit@amd.com>,
	"Bridgman, John" <John.Bridgman@amd.com>,
	"Linux-media@vger.kernel.org" <Linux-media@vger.kernel.org>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"logang@deltatee.com" <logang@deltatee.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Max Gurtovoy <maxg@mellanox.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"Sagalovitch, Serguei" <Serguei.Sagalovitch@amd.com>,
	"Blinzer, Paul" <Paul.Blinzer@amd.com>,
	"Kuehling, Felix" <Felix.Kuehling@amd.com>,
	"Sander, Ben" <ben.sander@amd.com>
Subject: RE: Enabling peer to peer device transactions for PCIe devices
Date: Wed, 30 Nov 2016 17:10:53 +0000	[thread overview]
Message-ID: <MWHPR12MB1694CF1A306B61BEEBFC77EFF78C0@MWHPR12MB1694.namprd12.prod.outlook.com> (raw)
In-Reply-To: <c0ddccf3-52ce-d883-a57a-70d8a1febf85@mellanox.com>

> -----Original Message-----
> From: Haggai Eran [mailto:haggaie@mellanox.com]
> Sent: Wednesday, November 30, 2016 5:46 AM
> To: Jason Gunthorpe
> Cc: linux-kernel@vger.kernel.org; linux-rdma@vger.kernel.org; linux-
> nvdimm@ml01.01.org; Koenig, Christian; Suthikulpanit, Suravee; Bridgman,
> John; Deucher, Alexander; Linux-media@vger.kernel.org;
> dan.j.williams@intel.com; logang@deltatee.com; dri-
> devel@lists.freedesktop.org; Max Gurtovoy; linux-pci@vger.kernel.org;
> Sagalovitch, Serguei; Blinzer, Paul; Kuehling, Felix; Sander, Ben
> Subject: Re: Enabling peer to peer device transactions for PCIe devices
> 
> On 11/28/2016 9:02 PM, Jason Gunthorpe wrote:
> > On Mon, Nov 28, 2016 at 06:19:40PM +0000, Haggai Eran wrote:
> >>>> GPU memory. We create a non-ODP MR pointing to VRAM but rely on
> >>>> user-space and the GPU not to migrate it. If they do, the MR gets
> >>>> destroyed immediately.
> >>> That sounds horrible. How can that possibly work? What if the MR is
> >>> being used when the GPU decides to migrate?
> >> Naturally this doesn't support migration. The GPU is expected to pin
> >> these pages as long as the MR lives. The MR invalidation is done only as
> >> a last resort to keep system correctness.
> >
> > That just forces applications to handle horrible unexpected
> > failures. If this sort of thing is needed for correctness then OOM
> > kill the offending process, don't corrupt its operation.
> Yes, that sounds fine. Can we simply kill the process from the GPU driver?
> Or do we need to extend the OOM killer to manage GPU pages?

Christian sent out an RFC patch a while back that extended the OOM to cover memory allocated for the GPU:
https://lists.freedesktop.org/archives/dri-devel/2015-September/089778.html

Alex

> 
> >
> >> I think it is similar to how non-ODP MRs rely on user-space today to
> >> keep them correct. If you do something like madvise(MADV_DONTNEED)
> on a
> >> non-ODP MR's pages, you can still get yourself into a data corruption
> >> situation (HCA sees one page and the process sees another for the same
> >> virtual address). The pinning that we use only guarentees the HCA's page
> >> won't be reused.
> >
> > That is not really data corruption - the data still goes where it was
> > originally destined. That is an application violating the
> > requirements of a MR.
> I guess it is a matter of terminology. If you compare it to the ODP case
> or the CPU case then you usually expect a single virtual address to map to
> a single physical page. Violating this cause some of your writes to be dropped
> which is a data corruption in my book, even if the application caused it.
> 
> > An application cannot munmap/mremap a VMA
> > while a non ODP MR points to it and then keep using the MR.
> Right. And it is perfectly fine to have some similar requirements from the
> application
> when doing peer to peer with a non-ODP MR.
> 
> > That is totally different from a GPU driver wanthing to mess with
> > translation to physical pages.
> >
> >>> From what I understand we are not really talking about kernel p2p,
> >>> everything proposed so far is being mediated by a userspace VMA, so
> >>> I'd focus on making that work.
> >
> >> Fair enough, although we will need both eventually, and I hope the
> >> infrastructure can be shared to some degree.
> >
> > What use case do you see for in kernel?
> Two cases I can think of are RDMA access to an NVMe device's controller
> memory buffer, and O_DIRECT operations that access GPU memory.
> Also, HMM's migration between two GPUs could use peer to peer in the
> kernel,
> although that is intended to be handled by the GPU driver if I understand
> correctly.
> 
> > Presumably in-kernel could use a vmap or something and the same basic
> > flow?
> I think we can achieve the kernel's needs with ZONE_DEVICE and DMA-API
> support
> for peer to peer. I'm not sure we need vmap. We need a way to have a
> scatterlist
> of MMIO pfns, and ZONE_DEVICE allows that.
> 
> Haggai

  parent reply	other threads:[~2016-11-30 17:45 UTC|newest]

Thread overview: 126+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-21 20:36 Enabling peer to peer device transactions for PCIe devices Deucher, Alexander
2016-11-22 18:11 ` Dan Williams
     [not found]   ` <75a1f44f-c495-7d1e-7e1c-17e89555edba@amd.com>
2016-11-22 20:01     ` Dan Williams
2016-11-22 20:10       ` Daniel Vetter
2016-11-22 20:24         ` Dan Williams
2016-11-22 20:35         ` Serguei Sagalovitch
2016-11-22 21:03           ` Daniel Vetter
2016-11-22 21:21             ` Dan Williams
2016-11-22 22:21               ` Sagalovitch, Serguei
2016-11-23  7:49               ` Daniel Vetter
2016-11-23  8:51                 ` Christian König
2016-11-23 19:27                   ` Serguei Sagalovitch
2016-11-23 17:03                 ` Dave Hansen
2016-11-23 17:13     ` Logan Gunthorpe
2016-11-23 17:27       ` Bart Van Assche
2016-11-23 18:40         ` Dan Williams
2016-11-23 19:12           ` Jason Gunthorpe
2016-11-23 19:24             ` Serguei Sagalovitch
2016-11-23 19:06         ` Serguei Sagalovitch
2016-11-23 19:05       ` Jason Gunthorpe
2016-11-23 19:14         ` Serguei Sagalovitch
2016-11-23 19:32           ` Jason Gunthorpe
     [not found]             ` <c2c88376-5ba7-37d1-4d3e-592383ebb00a@amd.com>
2016-11-23 20:33               ` Jason Gunthorpe
2016-11-23 21:11                 ` Logan Gunthorpe
2016-11-23 21:55                   ` Jason Gunthorpe
2016-11-23 22:42                     ` Dan Williams
2016-11-23 23:25                       ` Jason Gunthorpe
2016-11-24  9:45                         ` Christian König
2016-11-24 16:26                           ` Jason Gunthorpe
2016-11-24 17:00                             ` Serguei Sagalovitch
2016-11-24 17:55                           ` Logan Gunthorpe
2016-11-25 13:06                             ` Christian König
2016-11-25 16:45                               ` Logan Gunthorpe
2016-11-25 17:20                                 ` Serguei Sagalovitch
2016-11-25 20:26                                   ` Felix Kuehling
2016-11-25 20:48                                     ` Serguei Sagalovitch
2016-11-24  0:40                     ` Sagalovitch, Serguei
2016-11-24 16:24                       ` Jason Gunthorpe
2016-11-24  1:25                     ` Logan Gunthorpe
2016-11-24 16:42                       ` Jason Gunthorpe
2016-11-24 18:11                         ` Logan Gunthorpe
2016-11-25  7:58                           ` Christoph Hellwig
2016-11-25 19:41                             ` Jason Gunthorpe
2016-11-25 17:59                           ` Serguei Sagalovitch
2016-11-25 13:22                         ` Christian König
2016-11-25 17:16                           ` Serguei Sagalovitch
2016-11-25 19:34                             ` Jason Gunthorpe
2016-11-25 19:49                               ` Serguei Sagalovitch
2016-11-25 20:19                                 ` Jason Gunthorpe
2016-11-25 23:41                               ` Alex Deucher
2016-11-25 19:32                           ` Jason Gunthorpe
2016-11-25 20:40                             ` Christian König
2016-11-25 20:51                               ` Felix Kuehling
2016-11-25 21:18                               ` Jason Gunthorpe
2016-11-27  8:16                             ` Haggai Eran
2016-11-27 14:02                             ` Haggai Eran
2016-11-27 14:07                               ` Christian König
2016-11-28  5:31                                 ` zhoucm1
2016-11-28 14:48                               ` Serguei Sagalovitch
2016-11-28 18:36                                 ` Haggai Eran
2016-11-28 16:57                               ` Jason Gunthorpe
2016-11-28 18:19                                 ` Haggai Eran
2016-11-28 19:02                                   ` Jason Gunthorpe
2016-11-30 10:45                                     ` Haggai Eran
2016-11-30 16:23                                       ` Jason Gunthorpe
2016-11-30 17:28                                         ` Serguei Sagalovitch
2016-12-04  7:33                                           ` Haggai Eran
2016-11-30 18:01                                         ` Logan Gunthorpe
2016-12-04  7:42                                           ` Haggai Eran
2016-12-04 13:06                                             ` Stephen Bates
2016-12-04 13:23                                             ` Stephen Bates
2016-12-05 17:18                                               ` Jason Gunthorpe
2016-12-05 17:40                                                 ` Dan Williams
2016-12-05 18:02                                                   ` Jason Gunthorpe
2016-12-05 18:08                                                     ` Dan Williams
2016-12-05 18:39                                                       ` Logan Gunthorpe
2016-12-05 18:48                                                         ` Dan Williams
2016-12-05 19:14                                                           ` Jason Gunthorpe
2016-12-05 19:27                                                             ` Logan Gunthorpe
2016-12-05 19:46                                                               ` Jason Gunthorpe
2016-12-05 19:59                                                                 ` Logan Gunthorpe
2016-12-05 20:06                                                                 ` Christoph Hellwig
2016-12-06  8:06                                                           ` Stephen Bates
2016-12-06 16:38                                                             ` Jason Gunthorpe
2016-12-06 16:51                                                               ` Logan Gunthorpe
2016-12-06 17:28                                                                 ` Jason Gunthorpe
2016-12-06 21:47                                                                   ` Logan Gunthorpe
2016-12-06 22:02                                                                     ` Dan Williams
2016-12-06 17:12                                                               ` Christoph Hellwig
2016-12-04  7:53                                         ` Haggai Eran
2016-11-30 17:10                                       ` Deucher, Alexander [this message]
2016-11-28 18:20                                 ` Logan Gunthorpe
2016-11-28 19:35                                   ` Serguei Sagalovitch
2016-11-28 21:36                                     ` Logan Gunthorpe
2016-11-28 21:55                                       ` Serguei Sagalovitch
2016-11-28 22:24                                         ` Jason Gunthorpe
2017-01-05 18:39 ` Jerome Glisse
2017-01-05 19:01   ` Jason Gunthorpe
2017-01-05 19:54     ` Jerome Glisse
2017-01-05 20:07       ` Jason Gunthorpe
2017-01-05 20:19         ` Jerome Glisse
2017-01-05 22:42           ` Jason Gunthorpe
2017-01-05 23:23             ` Jerome Glisse
2017-01-06  0:30               ` Jason Gunthorpe
2017-01-06  0:41                 ` Serguei Sagalovitch
2017-01-06  1:58                 ` Jerome Glisse
2017-01-06 16:56                   ` Serguei Sagalovitch
2017-01-06 17:37                     ` Jerome Glisse
2017-01-06 18:26                       ` Jason Gunthorpe
2017-01-06 19:12                         ` Deucher, Alexander
2017-01-06 22:10                         ` Logan Gunthorpe
2017-01-12  4:54                           ` Stephen Bates
2017-01-12 15:11                             ` Jerome Glisse
2017-01-12 17:17                               ` Jason Gunthorpe
2017-01-13 13:04                               ` Christian König
2017-01-12 22:35                             ` Logan Gunthorpe
2017-01-06 15:08     ` Henrique Almeida
2017-10-20 12:36 ` Ludwig Petrosyan
2017-10-20 15:48   ` Logan Gunthorpe
2017-10-22  6:13     ` Petrosyan, Ludwig
2017-10-22 17:19       ` Logan Gunthorpe
2017-10-23 16:08       ` David Laight
2017-10-23 22:04         ` Logan Gunthorpe
2017-10-24  5:58           ` Petrosyan, Ludwig
2017-10-24 14:58             ` David Laight
2017-10-26 13:28               ` Petrosyan, Ludwig

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=MWHPR12MB1694CF1A306B61BEEBFC77EFF78C0@MWHPR12MB1694.namprd12.prod.outlook.com \
    --to=alexander.deucher@amd.com \
    --cc=Christian.Koenig@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=John.Bridgman@amd.com \
    --cc=Linux-media@vger.kernel.org \
    --cc=Paul.Blinzer@amd.com \
    --cc=Serguei.Sagalovitch@amd.com \
    --cc=Suravee.Suthikulpanit@amd.com \
    --cc=ben.sander@amd.com \
    --cc=dan.j.williams@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=haggaie@mellanox.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@ml01.01.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=logang@deltatee.com \
    --cc=maxg@mellanox.com \
    /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).