* [PATCH 0/2] Two HMM patches from MMOTS
@ 2019-05-28 22:44 Kuehling, Felix
[not found] ` <20190528224419.14124-1-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Kuehling, Felix @ 2019-05-28 22:44 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
These are two important HMM bug fixes to fix the HMM-based userptr
implementation. They are alread staged in MMOTS:
https://www.ozlabs.org/~akpm/mmots/broken-out/
Kuehling, Felix (1):
mm/hmm.c: only set FAULT_FLAG_ALLOW_RETRY for non-blocking
Philip Yang (1):
mm/hmm.c: support automatic NUMA balancing
mm/hmm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.17.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread[parent not found: <20190528224419.14124-1-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>]
* [PATCH 1/2] mm/hmm.c: support automatic NUMA balancing [not found] ` <20190528224419.14124-1-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org> @ 2019-05-28 22:44 ` Kuehling, Felix 2019-05-28 22:44 ` [PATCH 2/2] mm/hmm.c: only set FAULT_FLAG_ALLOW_RETRY for non-blocking Kuehling, Felix 1 sibling, 0 replies; 3+ messages in thread From: Kuehling, Felix @ 2019-05-28 22:44 UTC (permalink / raw) To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org From: Philip Yang <Philip.Yang@amd.com> While the page is migrating by NUMA balancing, HMM failed to detect this condition and still return the old page. Application will use the new page migrated, but driver pass the old page physical address to GPU, this crash the application later. Use pte_protnone(pte) to return this condition and then hmm_vma_do_fault will allocate new page. Link: http://lkml.kernel.org/r/20190510195258.9930-2-Felix.Kuehling@amd.com Signed-off-by: Philip Yang <Philip.Yang@amd.com> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Reviewed-by: Jérôme Glisse <jglisse@redhat.com> Cc: Alex Deucher <alex.deucher@amd.com> Cc: Dave Airlie <airlied@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> --- mm/hmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/hmm.c b/mm/hmm.c index 0db8491090b8..599d8e82db67 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -559,7 +559,7 @@ static int hmm_vma_handle_pmd(struct mm_walk *walk, static inline uint64_t pte_to_hmm_pfn_flags(struct hmm_range *range, pte_t pte) { - if (pte_none(pte) || !pte_present(pte)) + if (pte_none(pte) || !pte_present(pte) || pte_protnone(pte)) return 0; return pte_write(pte) ? range->flags[HMM_PFN_VALID] | range->flags[HMM_PFN_WRITE] : -- 2.17.1 _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] mm/hmm.c: only set FAULT_FLAG_ALLOW_RETRY for non-blocking [not found] ` <20190528224419.14124-1-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org> 2019-05-28 22:44 ` [PATCH 1/2] mm/hmm.c: support automatic NUMA balancing Kuehling, Felix @ 2019-05-28 22:44 ` Kuehling, Felix 1 sibling, 0 replies; 3+ messages in thread From: Kuehling, Felix @ 2019-05-28 22:44 UTC (permalink / raw) To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org From: "Kuehling, Felix" <Felix.Kuehling@amd.com> Don't set this flag by default in hmm_vma_do_fault. It is set conditionally just a few lines below. Setting it unconditionally can lead to handle_mm_fault doing a non-blocking fault, returning -EBUSY and unlocking mmap_sem unexpectedly. Link: http://lkml.kernel.org/r/20190510195258.9930-3-Felix.Kuehling@amd.com Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Reviewed-by: Jérôme Glisse <jglisse@redhat.com> Cc: Alex Deucher <alex.deucher@amd.com> Cc: Dave Airlie <airlied@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> --- mm/hmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/hmm.c b/mm/hmm.c index 599d8e82db67..018cb5c241a6 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -339,7 +339,7 @@ struct hmm_vma_walk { static int hmm_vma_do_fault(struct mm_walk *walk, unsigned long addr, bool write_fault, uint64_t *pfn) { - unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_REMOTE; + unsigned int flags = FAULT_FLAG_REMOTE; struct hmm_vma_walk *hmm_vma_walk = walk->private; struct hmm_range *range = hmm_vma_walk->range; struct vm_area_struct *vma = walk->vma; -- 2.17.1 _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-05-28 22:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-28 22:44 [PATCH 0/2] Two HMM patches from MMOTS Kuehling, Felix
[not found] ` <20190528224419.14124-1-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org>
2019-05-28 22:44 ` [PATCH 1/2] mm/hmm.c: support automatic NUMA balancing Kuehling, Felix
2019-05-28 22:44 ` [PATCH 2/2] mm/hmm.c: only set FAULT_FLAG_ALLOW_RETRY for non-blocking Kuehling, Felix
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox