summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Yang <Philip.Yang@amd.com>2019-05-23 16:32:31 -0400
committerJérôme Glisse <jglisse@redhat.com>2019-05-23 16:32:31 -0400
commit5aa38e2a07d2f47e16c0f629cb69e6817bab9a7f (patch)
treebf8b6aa26fb7275a38a9ca002daac5ae3515e568
parent54dee406374ce8adb352c48e175176247cb8db7c (diff)
mm/hmm: support automatic NUMA balancing
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. Signed-off-by: Philip Yang <Philip.Yang@amd.com>
-rw-r--r--mm/hmm.c2
1 files changed, 1 insertions, 1 deletions
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] :