Skip to contentSkip to conversation

drm/amdkfd: Remove svm range validated_once flag

PATCH In review Philip Yang 2 participants 2 messages Sep 15, 2023 – Sep 18, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdkfd: Remove svm range validated_once flag

The validated_once flag is not used after the prefault was removed, The prefault was needed to ensure validate all system memory pages at least once before mapping or migrating the range to GPU.

---
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 3 ---
 drivers/gpu/drm/amd/amdkfd/kfd_svm.h | 1 -
 2 files changed, 4 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_svm.c +0 -3
index 26018b1d6138..562da3c40515 100644
@@ -1730,9 +1730,6 @@ static int svm_range_validate_and_map(struct mm_struct *mm,
 		addr = next;
 	}
 
-	if (addr == end)
-		prange->validated_once = true;
-
 unreserve_out:
 	svm_range_unreserve_bos(ctx);
 	if (!r)
drivers/gpu/drm/amd/amdkfd/kfd_svm.h +0 -1
index 91715bf3233c..25f711905738 100644
@@ -132,7 +132,6 @@ struct svm_range {
 	struct list_head		child_list;
 	DECLARE_BITMAP(bitmap_access, MAX_GPU_INSTANCE);
 	DECLARE_BITMAP(bitmap_aip, MAX_GPU_INSTANCE);
-	bool				validated_once;
 	bool				mapped_to_gpu;
 };
 
Signature · 1 line
2.35.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Philip Yang

The validated_once flag is not used after the prefault was removed, The prefault was needed to ensure validate all system memory pages at least once before mapping or migrating the range to GPU.

Quoted 31 lines
---
  drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 3 ---
  drivers/gpu/drm/amd/amdkfd/kfd_svm.h | 1 -
  2 files changed, 4 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_svm.c +0 -3
index 26018b1d6138..562da3c40515 100644
@@ -1730,9 +1730,6 @@ static int svm_range_validate_and_map(struct mm_struct *mm,
  		addr = next;
  	}
 
-	if (addr == end)
-		prange->validated_once = true;
-
  unreserve_out:
  	svm_range_unreserve_bos(ctx);
  	if (!r)
drivers/gpu/drm/amd/amdkfd/kfd_svm.h +0 -1
index 91715bf3233c..25f711905738 100644
@@ -132,7 +132,6 @@ struct svm_range {
  	struct list_head		child_list;
  	DECLARE_BITMAP(bitmap_access, MAX_GPU_INSTANCE);
  	DECLARE_BITMAP(bitmap_aip, MAX_GPU_INSTANCE);
-	bool				validated_once;
  	bool				mapped_to_gpu;
  };