Skip to contentSkip to conversation

libhsakmt: add new flags for svm

PATCH New Eric Huang 1 participant 2 messages Jun 28, 2022

lore
Share & tools
lore

Eric Huang

author
#0 lore raw

PATCH 3/4 libhsakmt: add new flags for svm

It is to add new option for always keeping gpu mapping.

Change-Id Iebee35e6de4d52fa29f82dd19f6bbf5640249492
---
 include/linux/kfd_ioctl.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/kfd_ioctl.h +2 -0
index 8a0ed49..5c45f58 100644
@@ -1069,6 +1069,8 @@ struct kfd_ioctl_cross_memory_copy_args {
 #define KFD_IOCTL_SVM_FLAG_GPU_EXEC    0x00000010
 /* GPUs mostly read, may allow similar optimizations as RO, but writes fault */
 #define KFD_IOCTL_SVM_FLAG_GPU_READ_MOSTLY     0x00000020
+/* Keep GPU memory mapping always valid as if XNACK is disable */
+#define KFD_IOCTL_SVM_FLAG_GPU_ALWAYS_MAPPED   0x00000040
 
 /**
  * kfd_ioctl_svm_op - SVM ioctl operations
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 4/4 libhsakmt: allocate unified memory for ctx save restore area

To improve performance on queue preemption, allocate ctx s/r
area in VRAM instead of system memory, and migrate it back to system memory when VRAM is full.

Change-Id If775782027188dbe84b6868260e429373675434c
---
 include/hsakmttypes.h |   1 +
 src/queues.c          | 109 ++++++++++++++++++++++++++++++++++++------
 2 files changed, 96 insertions(+), 14 deletions(-)
include/hsakmttypes.h +1 -0
index 9063f85..2c1c7cc 100644
@@ -1329,6 +1329,7 @@ typedef enum _HSA_SVM_FLAGS {
 	HSA_SVM_FLAG_GPU_RO      = 0x00000008, // GPUs only read, allows replication
 	HSA_SVM_FLAG_GPU_EXEC    = 0x00000010, // Allow execution on GPU
 	HSA_SVM_FLAG_GPU_READ_MOSTLY = 0x00000020, // GPUs mostly read, may allow similar optimizations as RO, but writes fault
+	HSA_SVM_FLAG_GPU_ALWAYS_MAPPED = 0x00000040, // Keep GPU memory mapping always valid as if XNACK is disable
 } HSA_SVM_FLAGS;
 
 typedef enum _HSA_SVM_ATTR_TYPE {
src/queues.c +95 -14

142 lines not on this page · raw message

Signature · 1 line
2.25.1