Skip to contentSkip to conversation

Use MTYPE_NC for coarse-grain remote memory

PATCH In review Felix Kuehling 2 participants 4 messages May 10, 2021 – May 11, 2021

Subsystems (3)
lore
Share & tools
lore

Felix Kuehling

author maintainer
#0 lore raw

cover Use MTYPE_NC for coarse-grain remote memory

These patches are the result of deliberations with multiple AMD SW and HW teams with the goal of improving Aldebaran performance and harmonizing the Arcturus implementation with it.

Felix Kuehling (2):
drm/amdgpu: Arcturus: MTYPE_NC for coarse-grain remote memory drm/amdgpu: Albebaran: MTYPE_NC for coarse-grain remote memory

 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 6 ++++--
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c             | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author maintainer
#1 lore raw

PATCH 1/2 drm/amdgpu: Arcturus: MTYPE_NC for coarse-grain remote memory

MTYPE UC was used for a specific use case that ended up not being implemented. Use NC for better performance for coarse-grained memory where cache coherence during shader execution is not required.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 3 ++-
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c             | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +2 -1
index dfa025d694f8..941a204d28f5 100644
@@ -433,7 +433,8 @@ static uint64_t get_pte_flags(struct amdgpu_device *adev, struct kgd_mem *mem)
 				mapping_flags |= coherent ?
 					AMDGPU_VM_MTYPE_CC : AMDGPU_VM_MTYPE_RW;
 			else
-				mapping_flags |= AMDGPU_VM_MTYPE_UC;
+				mapping_flags |= coherent ?
+					AMDGPU_VM_MTYPE_UC : AMDGPU_VM_MTYPE_NC;
 		} else {
 			mapping_flags |= coherent ?
 				AMDGPU_VM_MTYPE_UC : AMDGPU_VM_MTYPE_NC;
drivers/gpu/drm/amd/amdkfd/kfd_svm.c +2 -1
index a165e51c4a1c..b11f2b364bbf 100644
@@ -1016,7 +1016,8 @@ svm_range_get_pte_flags(struct amdgpu_device *adev, struct svm_range *prange)
 				mapping_flags |= coherent ?
 					AMDGPU_VM_MTYPE_CC : AMDGPU_VM_MTYPE_RW;
 			} else {
-				mapping_flags |= AMDGPU_VM_MTYPE_UC;
+				mapping_flags |= coherent ?
+					AMDGPU_VM_MTYPE_UC : AMDGPU_VM_MTYPE_NC;
 				if (amdgpu_xgmi_same_hive(adev, bo_adev))
 					snoop = true;
 			}
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author maintainer
#2 lore raw

PATCH 2/2 drm/amdgpu: Albebaran: MTYPE_NC for coarse-grain remote memory

In reply to Felix Kuehling

MTYPE UC was used for a specific use case that ended up not being implemented. Use NC for better performance for coarse-grained memory where cache coherence during shader execution is not required.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 3 ++-
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c             | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +2 -1
index 941a204d28f5..93ee569f6a63 100644
@@ -453,7 +453,8 @@ static uint64_t get_pte_flags(struct amdgpu_device *adev, struct kgd_mem *mem)
 				if (adev->gmc.xgmi.connected_to_cpu)
 					snoop = true;
 			} else {
-				mapping_flags |= AMDGPU_VM_MTYPE_UC;
+				mapping_flags |= coherent ?
+					AMDGPU_VM_MTYPE_UC : AMDGPU_VM_MTYPE_NC;
 				if (amdgpu_xgmi_same_hive(adev, bo_adev))
 					snoop = true;
 			}
drivers/gpu/drm/amd/amdkfd/kfd_svm.c +2 -1
index b11f2b364bbf..a1b1981084fa 100644
@@ -1034,7 +1034,8 @@ svm_range_get_pte_flags(struct amdgpu_device *adev, struct svm_range *prange)
 				if (adev->gmc.xgmi.connected_to_cpu)
 					snoop = true;
 			} else {
-				mapping_flags |= AMDGPU_VM_MTYPE_UC;
+				mapping_flags |= coherent ?
+					AMDGPU_VM_MTYPE_UC : AMDGPU_VM_MTYPE_NC;
 				if (amdgpu_xgmi_same_hive(adev, bo_adev))
 					snoop = true;
 			}
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw
In reply to Felix Kuehling

This series is Reviewed-by: Oak Zeng <[email protected]>

Regards,
Oak

On 2021-05-10, 7:36 PM, "amd-gfx on behalf of Felix Kuehling" <[email protected] on behalf of [email protected]> wrote:

These patches are the result of deliberations with multiple AMD SW and HW teams with the goal of improving Aldebaran performance and harmonizing the Arcturus implementation with it.

Felix Kuehling (2):
drm/amdgpu: Arcturus: MTYPE_NC for coarse-grain remote memory drm/amdgpu: Albebaran: MTYPE_NC for coarse-grain remote memory

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 6 ++++--
drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)

--
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Coak.zeng%40amd.com%7Cb6429f0dc7084453347708d9140c5c91%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637562865601902303%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=EEC2K46eAbtQOn7ppe%2B4fuxeE8rTaWHN2rqPKk4VyGw%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx