Skip to contentSkip to conversation

drm/amdkfd: Use logical cpu id for building vcrat

RFC New Hillf Danton 1 participant 1 message Apr 16, 2019

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

RFC 1/1 drm/amdkfd: Use logical cpu id for building vcrat

Hi folks

In commit d1c234e2cd, arm64 is granted to build kfd. Currently, it is physical cpu id that is used for building the x86_64 vcrat, but logical cpu id is used instead for arm64, though the function name requires apicid. Can we use the physical id for both arches if it really has an up-hand over the logical one, as the following tiny diff represents?

drivers/gpu/drm/amd/amdkfd/kfd_topology.c +0 -0
@@ -1405,11 +1405,7 @@ static int kfd_cpumask_to_apic_id(const
	first_cpu_of_numa_node = cpumask_first(cpumask);
	if (first_cpu_of_numa_node >= nr_cpu_ids)
		return -1;

-#ifdef CONFIG_X86_64
- return cpu_data(first_cpu_of_numa_node).apicid;
-#else
- return first_cpu_of_numa_node;
-#endif
+ return cpu_physical_id(first_cpu_of_numa_node);
}
/* kfd_numa_node_to_apic_id - Returns the APIC ID of the first logical processor
--

Or is logical cpu id enough to do the work, with some cosmetic applied to the function names(not included in the following simple diff yet)?

thanks
Hillf

drivers/gpu/drm/amd/amdkfd/kfd_topology.c +0 -0
@@ -1405,11 +1405,7 @@ static int kfd_cpumask_to_apic_id(const
	first_cpu_of_numa_node = cpumask_first(cpumask);
	if (first_cpu_of_numa_node >= nr_cpu_ids)
		return -1;
-#ifdef CONFIG_X86_64
-	return cpu_data(first_cpu_of_numa_node).apicid;
-#else
	return first_cpu_of_numa_node;

-#endif
}
/* kfd_numa_node_to_apic_id - Returns the APIC ID of the first logical processor
--

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