<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 2023-10-10 10:32, Francis, David
wrote:<br>
</div>
<blockquote type="cite" cite="mid:MN2PR12MB2909BAAE46A5FAD2E4549FD7EFCDA@MN2PR12MB2909.namprd12.prod.outlook.com">
<style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div style="font-family: Aptos, Aptos_EmbeddedFont,
Aptos_MSFontService, Calibri, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">By the
intended semantics of the EXT_COHERENT parameter,</span><br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">it should
cause the driver to use MTYPE_UC instead of</span><br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">MTYPE_NC on
non-local gfx9.4.3 APU memory.</span><br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">Signed-off-by:
David Francis <a class="moz-txt-link-rfc2396E" href="mailto:David.Francis@amd.com"><David.Francis@amd.com></a></span><br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">---</span><br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0"> drivers/gpu/drm/amd/amdkfd/kfd_svm.c
| 2 +-</span><br style="font-family: "Segoe UI",
"Segoe UI Web (West European)", "Segoe
UI", -apple-system, BlinkMacSystemFont, Roboto,
"Helvetica Neue", sans-serif; font-size:
14.6667px; color: rgb(0, 0, 0); background-color: rgb(255,
255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0"> 1 file
changed, 1 insertion(+), 1 deletion(-)</span><br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">diff --git
a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c</span><br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">index
7b81233bc9ae..d9ef937308ed 100644</span><br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">---
a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c</span><br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">+++
b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c</span><br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">@@ -1286,7
+1286,7 @@ svm_range_get_pte_flags(struct kfd_node *node,</span><br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">
if (num_possible_nodes() <= 1)</span><br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">
mapping_flags |= mtype_local;</span><br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">
else</span><br style="font-family: "Segoe UI",
"Segoe UI Web (West European)", "Segoe
UI", -apple-system, BlinkMacSystemFont, Roboto,
"Helvetica Neue", sans-serif; font-size:
14.6667px; color: rgb(0, 0, 0); background-color: rgb(255,
255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">-
mapping_flags |= AMDGPU_VM_MTYPE_NC;</span><br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">+
mapping_flags |= ext_coherent ? AMDGPU_VM_MTYPE_UC :
AMDGPU_VM_MTYPE_NC;</span><br style="font-family:
"Segoe UI", "Segoe UI Web (West
European)", "Segoe UI", -apple-system,
BlinkMacSystemFont, Roboto, "Helvetica Neue",
sans-serif; font-size: 14.6667px; color: rgb(0, 0, 0);
background-color: rgb(255, 255, 255);" class="ContentPasted0">
</div>
</div>
</div>
</blockquote>
<p>Thanks for finding this bug, I think on NUMA system with
ext_coherent, we should use CC for local and UC for remote memory
from another NUMA node.</p>
<p>The NUMA locality check is done in
amdgpu_gmc_override_vm_pte_flag now, seems we need refactor and
move the check here in order to use the prange->flags.</p>
<p><br>
</p>
<p>Regards,</p>
<p>Philip<br>
</p>
<blockquote type="cite" cite="mid:MN2PR12MB2909BAAE46A5FAD2E4549FD7EFCDA@MN2PR12MB2909.namprd12.prod.outlook.com">
<div>
<div>
<div style="font-family: Aptos, Aptos_EmbeddedFont,
Aptos_MSFontService, Calibri, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">
/* system memory accessed by the dGPU */</span><br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">
} else {</span><br style="font-family: "Segoe
UI", "Segoe UI Web (West European)",
"Segoe UI", -apple-system, BlinkMacSystemFont,
Roboto, "Helvetica Neue", sans-serif; font-size:
14.6667px; color: rgb(0, 0, 0); background-color: rgb(255,
255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">
mapping_flags |= AMDGPU_VM_MTYPE_UC;</span><br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">--</span><br style="font-family: "Segoe UI", "Segoe UI
Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; color:
rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">
<span style="font-family: "Segoe UI", "Segoe
UI Web (West European)", "Segoe UI",
-apple-system, BlinkMacSystemFont, Roboto, "Helvetica
Neue", sans-serif; font-size: 14.6667px; display:
inline !important; color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255);" class="ContentPasted0">2.34.1</span><br>
</div>
</div>
</div>
</blockquote>
</body>
</html>