Skip to contentSkip to conversation

drm/amd: Check that a system is a NUMA system before looking for SRAT

PATCH In review Mario Limonciello 2 participants 3 messages Jun 3, 2023 – Jun 5, 2023

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

PATCH 1/1 drm/amd: Check that a system is a NUMA system before looking for SRAT

It's pointless on laptops to look for the SRAT table as these are not NUMA. Check the number of possible nodes is > 1 to decide whether to look for SRAT.

---
 drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +2 -1
index 950af6820153..3dcd8f8bc98e 100644
@@ -2041,7 +2041,8 @@ static int kfd_fill_gpu_direct_io_link_to_cpu(int *avail_size,
 	sub_type_hdr->proximity_domain_from = proximity_domain;
 
 #ifdef CONFIG_ACPI_NUMA
-	if (kdev->adev->pdev->dev.numa_node == NUMA_NO_NODE)
+	if (kdev->adev->pdev->dev.numa_node == NUMA_NO_NODE &&
+	    num_possible_nodes() > 1)
 		kfd_find_numa_node_in_srat(kdev);
 #endif
 #ifdef CONFIG_NUMA
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Mario Limonciello

It's pointless on laptops to look for the SRAT table as these are not NUMA. Check the number of possible nodes is > 1 to decide whether to look for SRAT.

I think we discussed this a while ago and I don't remember the exact issue that was meant to fix. Was just to get rid of an irritating warning in the kernel log? Anyway, the patch looks good to me.

Quoted 18 lines
---
  drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +2 -1
index 950af6820153..3dcd8f8bc98e 100644
@@ -2041,7 +2041,8 @@ static int kfd_fill_gpu_direct_io_link_to_cpu(int *avail_size,
  	sub_type_hdr->proximity_domain_from = proximity_domain;
 
  #ifdef CONFIG_ACPI_NUMA
-	if (kdev->adev->pdev->dev.numa_node == NUMA_NO_NODE)
+	if (kdev->adev->pdev->dev.numa_node == NUMA_NO_NODE &&
+	    num_possible_nodes() > 1)
  		kfd_find_numa_node_in_srat(kdev);
  #endif
  #ifdef CONFIG_NUMA
#2 lore raw

[Public]

Quoted 11 lines · Mario Limonciello
Quoted 6 lines

It's pointless on laptops to look for the SRAT table as these are not NUMA. Check the number of possible nodes is > 1 to decide whether to look for SRAT.

I think we discussed this a while ago and I don't remember the exact issue that was meant to fix. Was just to get rid of an irritating warning in the kernel log? Anyway, the patch looks good to me.

Yeah I forgot all about sending out the fix until I noticed it again recently.

Quoted 2 lines

Thanks!

Quoted 22 lines

Review

Quoted 7 lines

---
  drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c

drivers/gpu/drm/amd/amdkfd/kfd_crat.c static int kfd_fill_gpu_direct_io_link_to_cpu(int

Quoted 4 lines

index 950af6820153..3dcd8f8bc98e 100644

drivers/gpu/drm/amd/amdkfd/kfd_crat.c +0 -0
@@ -2041,7 +2041,8 @@ static int kfd_fill_gpu_direct_io_link_to_cpu(int

*avail_size,

Quoted 9 lines
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +2 -1
    sub_type_hdr->proximity_domain_from = proximity_domain;
 
  #ifdef CONFIG_ACPI_NUMA
-   if (kdev->adev->pdev->dev.numa_node == NUMA_NO_NODE)
+   if (kdev->adev->pdev->dev.numa_node == NUMA_NO_NODE &&
+       num_possible_nodes() > 1)
            kfd_find_numa_node_in_srat(kdev);
  #endif
  #ifdef CONFIG_NUMA