All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH  hmm 0/8] Various error case bug fixes for hmm_range_fault()
@ 2020-03-11 18:34 ` Jason Gunthorpe
  0 siblings, 0 replies; 153+ messages in thread
From: Jason Gunthorpe @ 2020-03-11 18:34 UTC (permalink / raw)
  To: Jerome Glisse, Ralph Campbell, Felix.Kuehling
  Cc: Philip Yang, John Hubbard, amd-gfx, linux-mm, Jason Gunthorpe,
	dri-devel, Christoph Hellwig

From: Jason Gunthorpe <jgg@mellanox.com>

The hmm_range_fault() flow is fairly complicated. The scheme allows the
caller to specify if it needs a usable result for each page, or if it only
needs the current page table status filled in. This mixture of behavior is
useful for a caller that wants to build a 'prefetch around fault'
algorithm.

Although we have no in-tree users of this capability, I am working on
having RDMA ODP work in this manner, and removing these bugs from
hmm_range_fault() is a necessary step.

The basic principles are:

 - If the caller did not ask for a VA to be valid then hmm_range_fault()
   should not fail because of that VA

 - If 0 is returned from hmm_range_fault() then the entire pfns array
   contains valid data

 - HMM_PFN_ERROR is set if faulting fails, or if asking for faulting
   would fail

 - A 0 return from hmm_range_fault() does not have HMM_PFN_ERROR in any
   VA's the caller asked to be valid

This series does not get there completely, I have a followup series
closing some more complex cases.

I tested this series using Ralph's hmm tester he posted a while back,
other testing would be appreciated.

Jason Gunthorpe (8):
  mm/hmm: add missing unmaps of the ptep during hmm_vma_handle_pte()
  mm/hmm: don't free the cached pgmap while scanning
  mm/hmm: do not call hmm_vma_walk_hole() while holding a spinlock
  mm/hmm: add missing pfns set to hmm_vma_walk_pmd()
  mm/hmm: add missing call to hmm_range_need_fault() before returning
    EFAULT
  mm/hmm: reorganize how !pte_present is handled in hmm_vma_handle_pte()
  mm/hmm: return -EFAULT when setting HMM_PFN_ERROR on requested valid
    pages
  mm/hmm: add missing call to hmm_pte_need_fault in HMM_PFN_SPECIAL
    handling

 mm/hmm.c | 166 ++++++++++++++++++++++++++-----------------------------
 1 file changed, 79 insertions(+), 87 deletions(-)

-- 
2.25.1

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

^ permalink raw reply	[flat|nested] 153+ messages in thread

end of thread, other threads:[~2020-03-17 14:18 UTC | newest]

Thread overview: 153+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-11 18:34 [PATCH hmm 0/8] Various error case bug fixes for hmm_range_fault() Jason Gunthorpe
2020-03-11 18:34 ` Jason Gunthorpe
2020-03-11 18:34 ` Jason Gunthorpe
2020-03-11 18:34 ` [PATCH hmm 1/8] mm/hmm: add missing unmaps of the ptep during hmm_vma_handle_pte() Jason Gunthorpe
2020-03-11 18:34   ` Jason Gunthorpe
2020-03-11 18:34   ` Jason Gunthorpe
2020-03-12  1:28   ` Ralph Campbell
2020-03-12  1:28     ` Ralph Campbell
2020-03-12  1:28     ` Ralph Campbell
2020-03-12 14:24     ` Jason Gunthorpe
2020-03-12 14:24       ` Jason Gunthorpe
2020-03-12 14:24       ` Jason Gunthorpe
2020-03-16  8:58   ` Christoph Hellwig
2020-03-16  8:58     ` Christoph Hellwig
2020-03-11 18:35 ` [PATCH hmm 2/8] mm/hmm: don't free the cached pgmap while scanning Jason Gunthorpe
2020-03-11 18:35   ` Jason Gunthorpe
2020-03-11 18:35   ` Jason Gunthorpe
2020-03-12  1:29   ` Ralph Campbell
2020-03-12  1:29     ` Ralph Campbell
2020-03-12  1:29     ` Ralph Campbell
2020-03-16  9:02   ` Christoph Hellwig
2020-03-16  9:02     ` Christoph Hellwig
2020-03-16 18:07     ` Jason Gunthorpe
2020-03-16 18:07       ` Jason Gunthorpe
2020-03-16 18:07       ` Jason Gunthorpe
2020-03-16 18:13       ` Christoph Hellwig
2020-03-16 18:13         ` Christoph Hellwig
2020-03-16 19:23         ` Jason Gunthorpe
2020-03-16 19:23           ` Jason Gunthorpe
2020-03-16 19:23           ` Jason Gunthorpe
2020-03-11 18:35 ` [PATCH hmm 3/8] mm/hmm: do not call hmm_vma_walk_hole() while holding a spinlock Jason Gunthorpe
2020-03-11 18:35   ` Jason Gunthorpe
2020-03-11 18:35   ` Jason Gunthorpe
2020-03-12  1:31   ` Ralph Campbell
2020-03-12  1:31     ` Ralph Campbell
2020-03-12  1:31     ` Ralph Campbell
2020-03-12  8:54   ` Steven Price
2020-03-12  8:54     ` Steven Price
2020-03-12  8:54     ` Steven Price
2020-03-12 10:28     ` [PATCH] mm/hmm: Simplify hmm_vma_walk_pud slightly Steven Price
2020-03-12 10:28       ` Steven Price
2020-03-12 10:28       ` Steven Price
2020-03-12 14:27       ` Jason Gunthorpe
2020-03-12 14:27         ` Jason Gunthorpe
2020-03-12 14:27         ` Jason Gunthorpe
2020-03-12 14:40         ` Steven Price
2020-03-12 14:40           ` Steven Price
2020-03-12 14:40           ` Steven Price
2020-03-12 15:11           ` Jason Gunthorpe
2020-03-12 15:11             ` Jason Gunthorpe
2020-03-12 15:11             ` Jason Gunthorpe
2020-03-12 16:16             ` Steven Price
2020-03-12 16:16               ` Steven Price
2020-03-12 16:16               ` Steven Price
2020-03-12 16:37               ` Jason Gunthorpe
2020-03-12 16:37                 ` Jason Gunthorpe
2020-03-12 16:37                 ` Jason Gunthorpe
2020-03-12 17:02                 ` Steven Price
2020-03-12 17:02                   ` Steven Price
2020-03-12 17:02                   ` Steven Price
2020-03-12 17:17                   ` Jason Gunthorpe
2020-03-12 17:17                     ` Jason Gunthorpe
2020-03-12 17:17                     ` Jason Gunthorpe
2020-03-13 19:55                   ` Jason Gunthorpe
2020-03-13 19:55                     ` Jason Gunthorpe
2020-03-13 19:55                     ` Jason Gunthorpe
2020-03-13 21:04                     ` Matthew Wilcox
2020-03-13 21:04                       ` Matthew Wilcox
2020-03-13 21:04                       ` Matthew Wilcox
2020-03-13 22:51                       ` Jason Gunthorpe
2020-03-13 22:51                         ` Jason Gunthorpe
2020-03-13 22:51                         ` Jason Gunthorpe
2020-03-16  9:05   ` [PATCH hmm 3/8] mm/hmm: do not call hmm_vma_walk_hole() while holding a spinlock Christoph Hellwig
2020-03-16  9:05     ` Christoph Hellwig
2020-03-16 12:56     ` Jason Gunthorpe
2020-03-16 12:56       ` Jason Gunthorpe
2020-03-16 12:56       ` Jason Gunthorpe
2020-03-11 18:35 ` [PATCH hmm 4/8] mm/hmm: add missing pfns set to hmm_vma_walk_pmd() Jason Gunthorpe
2020-03-11 18:35   ` Jason Gunthorpe
2020-03-11 18:35   ` Jason Gunthorpe
2020-03-12  1:33   ` Ralph Campbell
2020-03-12  1:33     ` Ralph Campbell
2020-03-12  1:33     ` Ralph Campbell
2020-03-16  9:06   ` Christoph Hellwig
2020-03-16  9:06     ` Christoph Hellwig
2020-03-11 18:35 ` [PATCH hmm 5/8] mm/hmm: add missing call to hmm_range_need_fault() before returning EFAULT Jason Gunthorpe
2020-03-11 18:35   ` Jason Gunthorpe
2020-03-11 18:35   ` Jason Gunthorpe
2020-03-12  1:34   ` Ralph Campbell
2020-03-12  1:34     ` Ralph Campbell
2020-03-12  1:34     ` Ralph Campbell
2020-03-16  9:07   ` Christoph Hellwig
2020-03-16  9:07     ` Christoph Hellwig
2020-03-11 18:35 ` [PATCH hmm 6/8] mm/hmm: reorganize how !pte_present is handled in hmm_vma_handle_pte() Jason Gunthorpe
2020-03-11 18:35   ` Jason Gunthorpe
2020-03-11 18:35   ` Jason Gunthorpe
2020-03-12  1:36   ` Ralph Campbell
2020-03-12  1:36     ` Ralph Campbell
2020-03-12  1:36     ` Ralph Campbell
2020-03-16  9:11   ` Christoph Hellwig
2020-03-16  9:11     ` Christoph Hellwig
2020-03-11 18:35 ` [PATCH hmm 7/8] mm/hmm: return -EFAULT when setting HMM_PFN_ERROR on requested valid pages Jason Gunthorpe
2020-03-11 18:35   ` Jason Gunthorpe
2020-03-11 18:35   ` Jason Gunthorpe
2020-03-12  1:36   ` Ralph Campbell
2020-03-12  1:36     ` Ralph Campbell
2020-03-12  1:36     ` Ralph Campbell
2020-03-12 14:35     ` Jason Gunthorpe
2020-03-12 14:35       ` Jason Gunthorpe
2020-03-12 14:35       ` Jason Gunthorpe
2020-03-16  9:12   ` Christoph Hellwig
2020-03-16  9:12     ` Christoph Hellwig
2020-03-11 18:35 ` [PATCH hmm 8/8] mm/hmm: add missing call to hmm_pte_need_fault in HMM_PFN_SPECIAL handling Jason Gunthorpe
2020-03-11 18:35   ` Jason Gunthorpe
2020-03-11 18:35   ` Jason Gunthorpe
2020-03-12  1:38   ` Ralph Campbell
2020-03-12  1:38     ` Ralph Campbell
2020-03-12  1:38     ` Ralph Campbell
2020-03-16  9:13   ` Christoph Hellwig
2020-03-16  9:13     ` Christoph Hellwig
2020-03-16 12:10     ` Jason Gunthorpe
2020-03-16 12:10       ` Jason Gunthorpe
2020-03-16 12:10       ` Jason Gunthorpe
2020-03-16 12:49       ` Christoph Hellwig
2020-03-16 12:49         ` Christoph Hellwig
2020-03-16 13:04         ` Jason Gunthorpe
2020-03-16 13:04           ` Jason Gunthorpe
2020-03-16 13:04           ` Jason Gunthorpe
2020-03-16 13:12           ` Christoph Hellwig
2020-03-16 13:12             ` Christoph Hellwig
2020-03-17 12:32             ` Christoph Hellwig
2020-03-17 12:32               ` Christoph Hellwig
2020-03-17 12:53               ` Jason Gunthorpe
2020-03-17 12:53                 ` Jason Gunthorpe
2020-03-17 12:53                 ` Jason Gunthorpe
2020-03-17 13:06                 ` Christoph Hellwig
2020-03-17 13:06                   ` Christoph Hellwig
2020-03-17 13:25                   ` Jason Gunthorpe
2020-03-17 13:25                     ` Jason Gunthorpe
2020-03-17 13:25                     ` Jason Gunthorpe
2020-03-16 12:51   ` Christoph Hellwig
2020-03-16 12:51     ` Christoph Hellwig
2020-03-12 19:33 ` [PATCH hmm 9/8] mm/hmm: do not check pmd_protnone twice in hmm_vma_handle_pmd() Jason Gunthorpe
2020-03-12 19:33   ` Jason Gunthorpe
2020-03-12 19:33   ` Jason Gunthorpe
2020-03-12 23:50   ` Ralph Campbell
2020-03-12 23:50     ` Ralph Campbell
2020-03-12 23:50     ` Ralph Campbell
2020-03-16  9:14   ` Christoph Hellwig
2020-03-16  9:14     ` Christoph Hellwig
2020-03-16 18:25 ` [PATCH hmm 0/8] Various error case bug fixes for hmm_range_fault() Jason Gunthorpe
2020-03-16 18:25   ` Jason Gunthorpe
2020-03-16 18:25   ` Jason Gunthorpe

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.