Re: [PATCH] drm/amdkfd: avoid svm dump when dynamic debug disabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 2023-07-19 um 14:03 schrieb Alex Sierra:
Set dynamic_svm_range_dump macro to avoid iterating over SVM lists
from svm_range_debug_dump when dynamic debug is disabled. Otherwise,
it could drop performance, specially with big number of SVM ranges.
Make sure both svm_range_set_attr and svm_range_debug_dump functions
are dynamically enabled to print svm_range_debug_dump debug traces.

Signed-off-by: Alex Sierra <alex.sierra@xxxxxxx>
Tested-by: Alex Sierra <alex.sierra@xxxxxxx>
Signed-off-by: Philip Yang <Philip.Yang@xxxxxxx>
Signed-off-by: Felix Kuehling <felix.kuehling@xxxxxxx>
---
  drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 2 +-
  drivers/gpu/drm/amd/amdkfd/kfd_svm.h | 3 +++
  2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
index 479c4f66afa7..0687f27f506c 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
@@ -3563,7 +3563,7 @@ svm_range_set_attr(struct kfd_process *p, struct mm_struct *mm,
  			break;
  	}
- svm_range_debug_dump(svms);
+	dynamic_svm_range_dump(svms);
mutex_unlock(&svms->lock);
  	mmap_read_unlock(mm);
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.h b/drivers/gpu/drm/amd/amdkfd/kfd_svm.h
index 21b14510882b..ed4cd501fafe 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.h
@@ -39,6 +39,9 @@
  #define SVM_ADEV_PGMAP_OWNER(adev)\
  			((adev)->hive ? (void *)(adev)->hive : (void *)(adev))
+#define dynamic_svm_range_dump(svms) \
+	_dynamic_func_call_no_desc("svm_range_dump", svm_range_debug_dump, svms)
+

This should be in kfd_svm.c. The function svm_range_debug_dump is a static function in that file. This macro is not useful outside of it.

Regards,
  Felix


  struct svm_range_bo {
  	struct amdgpu_bo		*bo;
  	struct kref			kref;



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux