AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Sierra <alex.sierra@amd.com>
To: amd-gfx@lists.freedesktop.org
Cc: Alex Sierra <alex.sierra@amd.com>
Subject: [PATCH 11/11] drm/amdkfd: inc counter on child ranges with xnack off
Date: Tue, 29 Jun 2021 13:02:06 -0500	[thread overview]
Message-ID: <20210629180206.8002-11-alex.sierra@amd.com> (raw)
In-Reply-To: <20210629180206.8002-1-alex.sierra@amd.com>

During GPU page table invalidation with xnack off, new ranges
split may occur concurrently in the same prange. Creating a new
child per split. Each child should also increment its
invalid counter, to assure GPU page table updates in these
ranges.

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
index 294c9480a184..67605e4bc3c6 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
@@ -1622,6 +1622,7 @@ svm_range_evict(struct svm_range *prange, struct mm_struct *mm,
 		unsigned long start, unsigned long last)
 {
 	struct svm_range_list *svms = prange->svms;
+	struct svm_range *pchild;
 	struct kfd_process *p;
 	int r = 0;
 
@@ -1633,6 +1634,12 @@ svm_range_evict(struct svm_range *prange, struct mm_struct *mm,
 	if (!p->xnack_enabled) {
 		int evicted_ranges;
 
+		list_for_each_entry(pchild, &prange->child_list, child_list) {
+			mutex_lock_nested(&pchild->lock, 1);
+			atomic_inc(&pchild->invalid);
+			mutex_unlock(&pchild->lock);
+		}
+
 		atomic_inc(&prange->invalid);
 		evicted_ranges = atomic_inc_return(&svms->evicted_ranges);
 		if (evicted_ranges != 1)
@@ -1650,7 +1657,6 @@ svm_range_evict(struct svm_range *prange, struct mm_struct *mm,
 		schedule_delayed_work(&svms->restore_work,
 			msecs_to_jiffies(AMDGPU_SVM_RANGE_RESTORE_DELAY_MS));
 	} else {
-		struct svm_range *pchild;
 		unsigned long s, l;
 
 		pr_debug("invalidate unmap svms 0x%p [0x%lx 0x%lx] from GPUs\n",
-- 
2.32.0

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

  parent reply	other threads:[~2021-06-29 18:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29 18:01 [PATCH 01/11] drm/amdkfd: device pgmap owner at the svm migrate init Alex Sierra
2021-06-29 18:01 ` [PATCH 02/11] drm/amdkfd: add owner ref param to get hmm pages Alex Sierra
2021-06-29 18:01 ` [PATCH 03/11] drm/amdkfd: set owner ref to svm range prefault Alex Sierra
2021-06-29 18:01 ` [PATCH 04/11] drm/amdgpu: get owner ref in validate and map Alex Sierra
2021-06-29 18:02 ` [PATCH 05/11] drm/amdkfd: use hmm range fault to get both domain pfns Alex Sierra
2021-06-29 18:02 ` [PATCH 06/11] drm/amdkfd: classify and map mixed svm range pages in GPU Alex Sierra
2021-06-29 18:02 ` [PATCH 07/11] drm/amdkfd: skip invalid pages during migrations Alex Sierra
2021-06-29 18:02 ` [PATCH 08/11] drm/amdkfd: skip migration for pages already in VRAM Alex Sierra
2021-06-29 18:02 ` [PATCH 09/11] drm/amdkfd: add invalid pages debug at vram migration Alex Sierra
2021-06-29 18:02 ` [PATCH 10/11] drm/amdkfd: Maintain svm_bo reference in page->zone_device_data Alex Sierra
2021-06-29 18:02 ` Alex Sierra [this message]
2021-06-29 19:00   ` [PATCH 11/11] drm/amdkfd: inc counter on child ranges with xnack off Felix Kuehling
2021-06-30  4:00 ` [PATCH 01/11] drm/amdkfd: device pgmap owner at the svm migrate init Felix Kuehling
2021-06-30  4:06   ` Felix Kuehling

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=20210629180206.8002-11-alex.sierra@amd.com \
    --to=alex.sierra@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /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