linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@mellanox.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Jerome Glisse <jglisse@redhat.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Ben Skeggs <bskeggs@redhat.com>,
	Felix Kuehling <Felix.Kuehling@amd.com>,
	Ralph Campbell <rcampbell@nvidia.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"nouveau@lists.freedesktop.org" <nouveau@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 04/15] mm: remove the pgmap field from struct hmm_vma_walk
Date: Fri, 16 Aug 2019 12:30:41 +0000	[thread overview]
Message-ID: <20190816123036.GD5412@mellanox.com> (raw)
In-Reply-To: <20190816044448.GB4093@lst.de>

On Fri, Aug 16, 2019 at 06:44:48AM +0200, Christoph Hellwig wrote:
> On Fri, Aug 16, 2019 at 12:43:07AM +0000, Jason Gunthorpe wrote:
> > On Thu, Aug 15, 2019 at 04:51:33PM -0400, Jerome Glisse wrote:
> > 
> > > struct page. In this case any way we can update the
> > > nouveau_dmem_page() to check that page page->pgmap == the
> > > expected pgmap.
> > 
> > I was also wondering if that is a problem.. just blindly doing a
> > container_of on the page->pgmap does seem like it assumes that only
> > this driver is using DEVICE_PRIVATE.
> > 
> > It seems like something missing in hmm_range_fault, it should be told
> > what DEVICE_PRIVATE is acceptable to trigger HMM_PFN_DEVICE_PRIVATE
> > and fault all others?
> 
> The whole device private handling in hmm and migrate_vma seems pretty
> broken as far as I can tell, and I have some WIP patches.  Basically we
> should not touch (or possibly eventually call migrate to ram eventually
> in the future) device private pages not owned by the caller, where I
> try to defined the caller by the dev_pagemap_ops instance.  

I think it needs to be more elaborate.

For instance, a system may have multiple DEVICE_PRIVATE map's owned by
the same driver - but multiple physical devices using that driver.

Each physical device's driver should only ever get DEVICE_PRIVATE
pages for it's own on-device memory. Never a DEVICE_PRIVATE for
another device's memory.

The dev_pagemap_ops would not be unique enough, right?

Probably also clusters of same-driver struct device can share a
DEVICE_PRIVATE, at least high end GPU's now have private memory
coherency busses between their devices.

Since we want to trigger migration to CPU on incompatible
DEVICE_PRIVATE pages, it seems best to sort this out in the
hmm_range_fault?

Maybe some sort of unique ID inside the page->pgmap and passed as
input?

Jason


  reply	other threads:[~2019-08-16 12:30 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-06 16:05 hmm cleanups, v2 Christoph Hellwig
2019-08-06 16:05 ` [PATCH 01/15] amdgpu: remove -EAGAIN handling for hmm_range_fault Christoph Hellwig
2019-08-06 16:05 ` [PATCH 02/15] amdgpu: don't initialize range->list in amdgpu_hmm_init_range Christoph Hellwig
2019-08-06 16:05 ` [PATCH 03/15] nouveau: pass struct nouveau_svmm to nouveau_range_fault Christoph Hellwig
2019-08-06 18:02   ` Jason Gunthorpe
2019-08-06 16:05 ` [PATCH 04/15] mm: remove the pgmap field from struct hmm_vma_walk Christoph Hellwig
2019-08-07 17:45   ` Jason Gunthorpe
2019-08-07 18:47     ` Dan Williams
2019-08-08  6:59       ` Christoph Hellwig
2019-08-14  1:36         ` Dan Williams
2019-08-14  7:38           ` Christoph Hellwig
2019-08-14 13:27             ` Jason Gunthorpe
2019-08-14 14:48               ` Dan Williams
2019-08-15 18:03                 ` Jerome Glisse
2019-08-15 19:22                   ` Jason Gunthorpe
2019-08-15 19:36                   ` Dan Williams
2019-08-15 19:43                     ` Jerome Glisse
2019-08-15 20:12                       ` Dan Williams
2019-08-15 20:33                         ` Jerome Glisse
2019-08-15 20:41                           ` Jason Gunthorpe
2019-08-15 20:47                             ` Dan Williams
2019-08-16  0:40                               ` Jason Gunthorpe
2019-08-16  3:54                                 ` Dan Williams
2019-08-16 12:24                                   ` Jason Gunthorpe
2019-08-16 17:21                                     ` Dan Williams
2019-08-16 17:28                                       ` Jason Gunthorpe
2019-08-16 21:10                                         ` Ralph Campbell
2019-08-15 20:51                             ` Jerome Glisse
2019-08-16  0:43                               ` Jason Gunthorpe
2019-08-16  4:44                                 ` Christoph Hellwig
2019-08-16 12:30                                   ` Jason Gunthorpe [this message]
2019-08-16 12:34                                     ` Christoph Hellwig
2019-08-16  4:41                           ` Christoph Hellwig
2019-08-06 16:05 ` [PATCH 05/15] mm: remove the unused vma argument to hmm_range_dma_unmap Christoph Hellwig
2019-08-06 16:05 ` [PATCH 06/15] mm: remove superflous arguments from hmm_range_register Christoph Hellwig
2019-08-06 16:05 ` [PATCH 07/15] mm: remove the page_shift member from struct hmm_range Christoph Hellwig
2019-08-07 17:51   ` Jason Gunthorpe
2019-08-06 16:05 ` [PATCH 08/15] mm: remove the mask variable in hmm_vma_walk_hugetlb_entry Christoph Hellwig
2019-08-06 18:02   ` Jason Gunthorpe
2019-08-06 16:05 ` [PATCH 09/15] mm: don't abuse pte_index() in hmm_vma_handle_pmd Christoph Hellwig
2019-08-07 17:18   ` Jason Gunthorpe
2019-08-06 16:05 ` [PATCH 10/15] mm: only define hmm_vma_walk_pud if needed Christoph Hellwig
2019-08-06 16:05 ` [PATCH 11/15] mm: cleanup the hmm_vma_handle_pmd stub Christoph Hellwig
2019-08-06 18:00   ` Jason Gunthorpe
2019-08-06 16:05 ` [PATCH 12/15] mm: cleanup the hmm_vma_walk_hugetlb_entry stub Christoph Hellwig
2019-08-06 16:05 ` [PATCH 13/15] mm: allow HMM_MIRROR on all architectures with MMU Christoph Hellwig
2019-08-06 16:05 ` [PATCH 14/15] mm: make HMM_MIRROR an implicit option Christoph Hellwig
2019-08-06 17:44   ` Jason Gunthorpe
2019-08-06 16:05 ` [PATCH 15/15] amdgpu: remove CONFIG_DRM_AMDGPU_USERPTR Christoph Hellwig
2019-08-06 17:44   ` Jason Gunthorpe
2019-08-06 17:51     ` Kuehling, Felix
2019-08-06 18:58       ` Alex Deucher
2019-08-06 20:03         ` Jason Gunthorpe
2019-08-07  6:57           ` Koenig, Christian
2019-08-07 11:46             ` Jason Gunthorpe
2019-08-07 18:17 ` hmm cleanups, v2 Jason 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=20190816123036.GD5412@mellanox.com \
    --to=jgg@mellanox.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bskeggs@redhat.com \
    --cc=dan.j.williams@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hch@lst.de \
    --cc=jglisse@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=rcampbell@nvidia.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).