iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Jerome Glisse <j.glisse-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Yisheng Xie <xieyisheng1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"oded.gabbay-5C7GfCeVMHo@public.gmane.org"
	<oded.gabbay-5C7GfCeVMHo@public.gmane.org>,
	"iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
	<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	"Wanzongshun (Vincent)"
	<wanzongshun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
	"Wuzongyong (Cordius Wu,
	Euler Dept)"
	<wuzongyong1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Subject: Re: What differences and relations between SVM, HSA, HMM and Unified Memory?
Date: Mon, 17 Jul 2017 10:27:44 -0400	[thread overview]
Message-ID: <20170717142743.GA9420@gmail.com> (raw)
In-Reply-To: <1c4f4fb0-7201-ed4c-aa88-4d7e2369238e-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

On Mon, Jul 17, 2017 at 07:57:23PM +0800, Yisheng Xie wrote:
> Hi Jean-Philippe,
> 
> On 2017/6/12 19:37, Jean-Philippe Brucker wrote:
> > Hello,
> > 
> > On 10/06/17 05:06, Wuzongyong (Cordius Wu, Euler Dept) wrote:
> >> Hi,
> >>
> >> Could someone explain differences and relations between the SVM(Shared
> >> Virtual Memory, by Intel), HSA(Heterogeneous System Architecture, by AMD),
> >> HMM(Heterogeneous Memory Management, by Glisse) and UM(Unified Memory, by
> >> NVIDIA) ? Are these in the substitutional relation?
> >>
> >> As I understand it, these aim to solve the same thing, sharing pointers
> >> between CPU and GPU(implement with ATS/PASID/PRI/IOMMU support). So far,
> >> SVM and HSA can only be used by integrated gpu. And, Intel declare that
> >> the root ports doesn’t not have the required TLP prefix support, resulting
> >>  that SVM can’t be used by discrete devices. So could someone tell me the
> >> required TLP prefix means what specifically?>
> >> With HMM, we can use allocator like malloc to manage host and device
> >> memory. Does this mean that there is no need to use SVM and HSA with HMM,
> >> or HMM is the basis of SVM and HAS to implement Fine-Grained system SVM
> >> defined in the opencl spec?
> > 
> > I can't provide an exhaustive answer, but I have done some work on SVM.
> > Take it with a grain of salt though, I am not an expert.
> > 
> > * HSA is an architecture that provides a common programming model for CPUs
> > and accelerators (GPGPUs etc). It does have SVM requirement (I/O page
> > faults, PASID and compatible address spaces), though it's only a small
> > part of it.
> > 
> > * Similarly, OpenCL provides an API for dealing with accelerators. OpenCL
> > 2.0 introduced the concept of Fine-Grained System SVM, which allows to
> > pass userspace pointers to devices. It is just one flavor of SVM, they
> > also have coarse-grained and non-system. But they might have coined the
> > name, and I believe that in the context of Linux IOMMU, when we talk about
> > "SVM" it is OpenCL's fine-grained system SVM.
> > [...]
> > 
> > While SVM is only about virtual address space,
> As you mentioned, SVM is only about virtual address space, I'd like to know how to
> manage the physical address especially about device's RAM, before HMM?
> 
> When OpenCL alloc a SVM pointer like:
>     void* p = clSVMAlloc (
>         context, // an OpenCL context where this buffer is available
>         CL_MEM_READ_WRITE | CL_MEM_SVM_FINE_GRAIN_BUFFER,
>         size, // amount of memory to allocate (in bytes)
>         0 // alignment in bytes (0 means default)
>     );
> 
> where this RAM come from, device RAM or host RAM?
> 

For SVM using ATS/PASID with FINE_GRAIN your allocation can only
be inside the system memory (host RAM). You need a special system
bus like CAPI or CCIX which both are step further than ATS/PASID
to be able to allow fine grain to use device memory.

However that is where HMM can be usefull as HMM is a software
solution to this problem. So with HMM and a device that can work
with HMM, you can get fine grain allocation to also use device
memory however any CPU access will happen in host RAM.

Jérôme
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  parent reply	other threads:[~2017-07-17 14:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-10  4:06 What differences and relations between SVM, HSA, HMM and Unified Memory? Wuzongyong (Cordius Wu, Euler Dept)
2017-06-12 11:37 ` Jean-Philippe Brucker
2017-07-17 11:57   ` Yisheng Xie
2017-07-17 12:52     ` Jean-Philippe Brucker
     [not found]     ` <1c4f4fb0-7201-ed4c-aa88-4d7e2369238e-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-07-17 14:27       ` Jerome Glisse [this message]
2017-07-18  0:15         ` Yisheng Xie
     [not found] ` <9BD73EA91F8E404F851CF3F519B14AA8CE753F-OQh+Io27EUn0mp2XfTw+mgK1hpo4iccwjNknBlVQO8k@public.gmane.org>
2017-06-12 18:44   ` Jerome Glisse
     [not found]     ` <20170612184413.GA5924-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-13 12:36       ` 答复: " Wuzongyong (Cordius Wu, Euler Dept)

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=20170717142743.GA9420@gmail.com \
    --to=j.glisse-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=oded.gabbay-5C7GfCeVMHo@public.gmane.org \
    --cc=wanzongshun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=wuzongyong1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    --cc=xieyisheng1-hv44wF8Li93QT0dZR+AlfA@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 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).