All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerome Glisse <jglisse@redhat.com>
To: Niranjan Vishwanathapura <niranjana.vishwanathapura@intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"sanjay.k.kumar@intel.com" <sanjay.k.kumar@intel.com>,
	"sudeep.dutt@intel.com" <sudeep.dutt@intel.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"dave.hansen@intel.com" <dave.hansen@intel.com>,
	Jason Gunthorpe <jgg@mellanox.com>,
	"jon.bloomfield@intel.com" <jon.bloomfield@intel.com>,
	"daniel.vetter@intel.com" <daniel.vetter@intel.com>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"ira.weiny@intel.com" <ira.weiny@intel.com>
Subject: Re: [RFC 06/13] drm/i915/svm: Page table mirroring support
Date: Wed, 4 Dec 2019 16:51:36 -0500	[thread overview]
Message-ID: <20191204215136.GA4049@redhat.com> (raw)
In-Reply-To: <20191203191943.GQ14488@nvishwa1-DESK.sc.intel.com>

On Tue, Dec 03, 2019 at 11:19:43AM -0800, Niranjan Vishwanathapura wrote:
> On Tue, Nov 26, 2019 at 06:32:52PM +0000, Jason Gunthorpe wrote:
> > On Mon, Nov 25, 2019 at 11:33:27AM -0500, Jerome Glisse wrote:
> > > On Fri, Nov 22, 2019 at 11:33:12PM +0000, Jason Gunthorpe wrote:
> > > > On Fri, Nov 22, 2019 at 12:57:27PM -0800, Niranjana Vishwanathapura wrote:
> > > 
> > > [...]
> > > 
> > > > > +static int
> > > > > +i915_range_fault(struct i915_svm *svm, struct hmm_range *range)
> > > > > +{
> > > > > +	long ret;
> > > > > +
> > > > > +	range->default_flags = 0;
> > > > > +	range->pfn_flags_mask = -1UL;
> > > > > +
> > > > > +	ret = hmm_range_register(range, &svm->mirror);
> > > > > +	if (ret) {
> > > > > +		up_read(&svm->mm->mmap_sem);
> > > > > +		return (int)ret;
> > > > > +	}
> > > >
> > > >
> > > > Using a temporary range is the pattern from nouveau, is it really
> > > > necessary in this driver?
> > > 
> > > Just to comment on this, for GPU the usage model is not application
> > > register range of virtual address it wants to use. It is GPU can
> > > access _any_ CPU valid address just like the CPU would (modulo mmap
> > > of device file).
> > > 
> > > This is because the API you want in userspace is application passing
> > > random pointer to the GPU and GPU being able to chase down any kind
> > > of random pointer chain (assuming all valid ie pointing to valid
> > > virtual address for the process).
> > > 
> > > This is unlike the RDMA case.
> > 
> > No, RDMA has the full address space option as well, it is called
> > 'implicit ODP'
> > 
> > This is implemented by registering ranges at a level in our page
> > table (currently 512G) whenever that level has populated pages below
> > it.
> > 
> > I think is a better strategy than temporary ranges.

HMM original design did not have range and was well suited to nouveau.
Recent changes make it more tie to the range and less suited to nouveau.
I would not consider 512GB implicit range as good thing. Plan i have is
to create implicit range and align them on vma. I do not know when i will
have time to get to that.

> > 
> > But other GPU drivers like AMD are using BO and TTM objects with fixed
> > VA ranges and the range is tied to the BO/TTM.
> > 
> > I'm not sure if this i915 usage is closer to AMD or closer to nouveau.
> > 
> 
> I don't know the full details of the HMM usecases in amd and nouveau.
> AMD seems to be using it for usrptr objects which is tied to a BO.
> I am not sure if nouveau has any BO tied to these address ranges.

It is closer to nouveau, AMD usage is old userptr usecase where you have
a BO tie to range. While SVM means any valid CPU address and thus imply
that there is no BO tie to it (there is still BO usecase that must still
work here).

Cheers,
Jérôme

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Jerome Glisse <jglisse@redhat.com>
To: Niranjan Vishwanathapura <niranjana.vishwanathapura@intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"sanjay.k.kumar@intel.com" <sanjay.k.kumar@intel.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"dave.hansen@intel.com" <dave.hansen@intel.com>,
	Jason Gunthorpe <jgg@mellanox.com>,
	"daniel.vetter@intel.com" <daniel.vetter@intel.com>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"ira.weiny@intel.com" <ira.weiny@intel.com>
Subject: Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support
Date: Wed, 4 Dec 2019 16:51:36 -0500	[thread overview]
Message-ID: <20191204215136.GA4049@redhat.com> (raw)
In-Reply-To: <20191203191943.GQ14488@nvishwa1-DESK.sc.intel.com>

On Tue, Dec 03, 2019 at 11:19:43AM -0800, Niranjan Vishwanathapura wrote:
> On Tue, Nov 26, 2019 at 06:32:52PM +0000, Jason Gunthorpe wrote:
> > On Mon, Nov 25, 2019 at 11:33:27AM -0500, Jerome Glisse wrote:
> > > On Fri, Nov 22, 2019 at 11:33:12PM +0000, Jason Gunthorpe wrote:
> > > > On Fri, Nov 22, 2019 at 12:57:27PM -0800, Niranjana Vishwanathapura wrote:
> > > 
> > > [...]
> > > 
> > > > > +static int
> > > > > +i915_range_fault(struct i915_svm *svm, struct hmm_range *range)
> > > > > +{
> > > > > +	long ret;
> > > > > +
> > > > > +	range->default_flags = 0;
> > > > > +	range->pfn_flags_mask = -1UL;
> > > > > +
> > > > > +	ret = hmm_range_register(range, &svm->mirror);
> > > > > +	if (ret) {
> > > > > +		up_read(&svm->mm->mmap_sem);
> > > > > +		return (int)ret;
> > > > > +	}
> > > >
> > > >
> > > > Using a temporary range is the pattern from nouveau, is it really
> > > > necessary in this driver?
> > > 
> > > Just to comment on this, for GPU the usage model is not application
> > > register range of virtual address it wants to use. It is GPU can
> > > access _any_ CPU valid address just like the CPU would (modulo mmap
> > > of device file).
> > > 
> > > This is because the API you want in userspace is application passing
> > > random pointer to the GPU and GPU being able to chase down any kind
> > > of random pointer chain (assuming all valid ie pointing to valid
> > > virtual address for the process).
> > > 
> > > This is unlike the RDMA case.
> > 
> > No, RDMA has the full address space option as well, it is called
> > 'implicit ODP'
> > 
> > This is implemented by registering ranges at a level in our page
> > table (currently 512G) whenever that level has populated pages below
> > it.
> > 
> > I think is a better strategy than temporary ranges.

HMM original design did not have range and was well suited to nouveau.
Recent changes make it more tie to the range and less suited to nouveau.
I would not consider 512GB implicit range as good thing. Plan i have is
to create implicit range and align them on vma. I do not know when i will
have time to get to that.

> > 
> > But other GPU drivers like AMD are using BO and TTM objects with fixed
> > VA ranges and the range is tied to the BO/TTM.
> > 
> > I'm not sure if this i915 usage is closer to AMD or closer to nouveau.
> > 
> 
> I don't know the full details of the HMM usecases in amd and nouveau.
> AMD seems to be using it for usrptr objects which is tied to a BO.
> I am not sure if nouveau has any BO tied to these address ranges.

It is closer to nouveau, AMD usage is old userptr usecase where you have
a BO tie to range. While SVM means any valid CPU address and thus imply
that there is no BO tie to it (there is still BO usecase that must still
work here).

Cheers,
Jérôme

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-12-04 21:51 UTC|newest]

Thread overview: 111+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22 20:57 [RFC 00/13] drm/i915/svm: Add SVM support Niranjana Vishwanathapura
2019-11-22 20:57 ` [Intel-gfx] " Niranjana Vishwanathapura
2019-11-22 20:57 ` [RFC 01/13] drm/i915/svm: Add SVM documentation Niranjana Vishwanathapura
2019-11-22 20:57   ` [Intel-gfx] " Niranjana Vishwanathapura
2019-11-22 20:57 ` [RFC 02/13] drm/i915/svm: Define SVM UAPI Niranjana Vishwanathapura
2019-11-22 20:57   ` [Intel-gfx] " Niranjana Vishwanathapura
2019-11-22 20:57   ` Niranjana Vishwanathapura
2019-11-26 13:44   ` Joonas Lahtinen
2019-11-26 13:44     ` [Intel-gfx] " Joonas Lahtinen
2019-11-26 13:44     ` Joonas Lahtinen
2019-11-28  2:04     ` Niranjan Vishwanathapura
2019-11-28  2:04       ` [Intel-gfx] " Niranjan Vishwanathapura
2019-11-28  2:04       ` Niranjan Vishwanathapura
2019-11-22 20:57 ` [RFC 03/13] drm/i915/svm: Runtime (RT) allocator support Niranjana Vishwanathapura
2019-11-22 20:57   ` [Intel-gfx] " Niranjana Vishwanathapura
2019-11-22 20:57   ` Niranjana Vishwanathapura
2019-11-25  9:59   ` Chris Wilson
2019-11-25  9:59     ` [Intel-gfx] " Chris Wilson
2019-11-25  9:59     ` Chris Wilson
2019-11-25 16:40     ` Niranjan Vishwanathapura
2019-11-25 16:40       ` [Intel-gfx] " Niranjan Vishwanathapura
2019-11-25 16:40       ` Niranjan Vishwanathapura
2019-11-26 13:59       ` Joonas Lahtinen
2019-11-26 13:59         ` Joonas Lahtinen
2019-11-27 19:23         ` Niranjan Vishwanathapura
2019-11-27 19:23           ` [Intel-gfx] " Niranjan Vishwanathapura
2019-11-27 19:23           ` Niranjan Vishwanathapura
2019-11-28 12:12           ` Joonas Lahtinen
2019-11-28 12:12             ` [Intel-gfx] " Joonas Lahtinen
2019-11-28 12:12             ` Joonas Lahtinen
2019-12-02 19:59             ` Niranjan Vishwanathapura
2019-12-02 19:59               ` [Intel-gfx] " Niranjan Vishwanathapura
2019-12-02 19:59               ` Niranjan Vishwanathapura
2019-11-22 20:57 ` [RFC 04/13] drm/i915/svm: Implicitly migrate BOs upon CPU access Niranjana Vishwanathapura
2019-11-22 20:57   ` [Intel-gfx] " Niranjana Vishwanathapura
2019-11-22 20:57   ` Niranjana Vishwanathapura
2019-11-22 20:57 ` [RFC 05/13] drm/i915/svm: Page table update support for SVM Niranjana Vishwanathapura
2019-11-22 20:57   ` [Intel-gfx] " Niranjana Vishwanathapura
2019-11-22 20:57   ` Niranjana Vishwanathapura
2019-11-22 20:57 ` [RFC 06/13] drm/i915/svm: Page table mirroring support Niranjana Vishwanathapura
2019-11-22 20:57   ` [Intel-gfx] " Niranjana Vishwanathapura
2019-11-22 20:57   ` Niranjana Vishwanathapura
2019-11-22 23:33   ` Jason Gunthorpe
2019-11-22 23:33     ` [Intel-gfx] " Jason Gunthorpe
2019-11-22 23:33     ` Jason Gunthorpe
2019-11-23  4:44     ` Niranjan Vishwanathapura
2019-11-23  4:44       ` [Intel-gfx] " Niranjan Vishwanathapura
2019-11-23  4:44       ` Niranjan Vishwanathapura
2019-11-23 23:53       ` Jason Gunthorpe
2019-11-23 23:53         ` [Intel-gfx] " Jason Gunthorpe
2019-11-23 23:53         ` Jason Gunthorpe
2019-11-24 21:12         ` Niranjan Vishwanathapura
2019-11-24 21:12           ` [Intel-gfx] " Niranjan Vishwanathapura
2019-11-24 21:12           ` Niranjan Vishwanathapura
2019-11-25 13:24           ` Jason Gunthorpe
2019-11-25 13:24             ` [Intel-gfx] " Jason Gunthorpe
2019-11-25 13:24             ` Jason Gunthorpe
2019-11-25 16:32             ` Niranjan Vishwanathapura
2019-11-25 16:32               ` [Intel-gfx] " Niranjan Vishwanathapura
2019-11-26 18:45               ` Jason Gunthorpe
2019-11-26 18:45                 ` [Intel-gfx] " Jason Gunthorpe
2019-11-26 18:45                 ` Jason Gunthorpe
2019-12-03 19:07                 ` Niranjan Vishwanathapura
2019-12-03 19:07                   ` [Intel-gfx] " Niranjan Vishwanathapura
2019-11-25 16:34             ` Jerome Glisse
2019-11-25 16:34               ` [Intel-gfx] " Jerome Glisse
2019-11-25 16:34               ` Jerome Glisse
2019-11-25 16:33     ` Jerome Glisse
2019-11-25 16:33       ` [Intel-gfx] " Jerome Glisse
2019-11-25 21:29       ` Niranjan Vishwanathapura
2019-11-25 21:29         ` [Intel-gfx] " Niranjan Vishwanathapura
2019-11-26 18:32       ` Jason Gunthorpe
2019-11-26 18:32         ` [Intel-gfx] " Jason Gunthorpe
2019-11-26 18:32         ` Jason Gunthorpe
2019-12-03 19:19         ` Niranjan Vishwanathapura
2019-12-03 19:19           ` [Intel-gfx] " Niranjan Vishwanathapura
2019-12-04 21:51           ` Jerome Glisse [this message]
2019-12-04 21:51             ` Jerome Glisse
2019-12-08 18:23             ` Jason Gunthorpe
2019-12-08 18:23               ` [Intel-gfx] " Jason Gunthorpe
2019-11-22 20:57 ` [RFC 07/13] drm/i915/svm: Device memory support Niranjana Vishwanathapura
2019-11-22 20:57   ` [Intel-gfx] " Niranjana Vishwanathapura
2019-11-22 20:57   ` Niranjana Vishwanathapura
2019-11-22 20:57 ` [RFC 08/13] drm/i915/svm: Implicitly migrate pages upon CPU fault Niranjana Vishwanathapura
2019-11-22 20:57   ` [Intel-gfx] " Niranjana Vishwanathapura
2019-11-22 20:57 ` [RFC 09/13] drm/i915/svm: Page copy support during migration Niranjana Vishwanathapura
2019-11-22 20:57   ` [Intel-gfx] " Niranjana Vishwanathapura
2019-11-22 20:57   ` Niranjana Vishwanathapura
2019-11-22 20:57 ` [RFC 10/13] drm/i915/svm: Add functions to blitter copy SVM buffers Niranjana Vishwanathapura
2019-11-22 20:57   ` [Intel-gfx] " Niranjana Vishwanathapura
2019-11-22 20:57   ` Niranjana Vishwanathapura
2019-11-22 20:57 ` [RFC 11/13] drm/i915/svm: Use blitter copy for migration Niranjana Vishwanathapura
2019-11-22 20:57   ` [Intel-gfx] " Niranjana Vishwanathapura
2019-11-22 20:57 ` [RFC 12/13] drm/i915/svm: Add support to en/disable SVM Niranjana Vishwanathapura
2019-11-22 20:57   ` [Intel-gfx] " Niranjana Vishwanathapura
2019-11-22 20:57   ` Niranjana Vishwanathapura
2019-11-22 20:57 ` [RFC 13/13] drm/i915/svm: Add page table dump support Niranjana Vishwanathapura
2019-11-22 20:57   ` [Intel-gfx] " Niranjana Vishwanathapura
2019-11-22 21:32 ` ✗ Fi.CI.BUILD: failure for drm/i915/svm: Add SVM support Patchwork
2019-11-22 21:32   ` [Intel-gfx] " Patchwork
2019-11-26 14:03 ` [RFC 00/13] " Joonas Lahtinen
2019-11-26 14:03   ` [Intel-gfx] " Joonas Lahtinen
2019-11-26 14:03   ` Joonas Lahtinen
2019-12-02 19:37   ` Niranjan Vishwanathapura
2019-12-02 19:37     ` [Intel-gfx] " Niranjan Vishwanathapura
2019-12-02 19:37     ` Niranjan Vishwanathapura
     [not found] <20191122195452.14346-1-niranjana.vishwanathapura@intel.com>
     [not found] ` <20191122195452.14346-7-niranjana.vishwanathapura@intel.com>
2019-11-22 20:01   ` [RFC 06/13] drm/i915/svm: Page table mirroring support Niranjan Vishwanathapura
2019-11-22 20:01     ` Niranjan Vishwanathapura
2019-11-22 20:14     ` Jason Gunthorpe
2019-11-22 20:14       ` Jason Gunthorpe
2019-11-22 20:11       ` Niranjan Vishwanathapura

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=20191204215136.GA4049@redhat.com \
    --to=jglisse@redhat.com \
    --cc=dan.j.williams@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ira.weiny@intel.com \
    --cc=jgg@mellanox.com \
    --cc=jon.bloomfield@intel.com \
    --cc=niranjana.vishwanathapura@intel.com \
    --cc=sanjay.k.kumar@intel.com \
    --cc=sudeep.dutt@intel.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 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.