Skip to contentSkip to conversation

platform/x86: ISST: Fix optimization with use of numa

PATCH In review Srinivas Pandruvada 2 participants 2 messages Aug 11, 2021 – Aug 12, 2021 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 platform/x86: ISST: Fix optimization with use of numa

When numa is used to map CPU to PCI device, the optimized path to read from cached data is not working and still calls _isst_if_get_pci_dev().

The reason is that when caching the mapping, numa information is not available as it is read later. So move the assignment of isst_cpu_info[cpu].numa_node before calling _isst_if_get_pci_dev().

Fixes aa2ddd242572 ("platform/x86: ISST: Use numa node id for cpu pci dev mapping")

---
v2:
Fixed "Fixes tag" as suggested by Stephen Rothwell

Update:
The fixes tag was wrong
This patch can wait for next merge window as these systems are not shipped.

 drivers/platform/x86/intel_speed_select_if/isst_if_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/x86/intel_speed_select_if/isst_if_common.c +2 -1
index 6f0cc679c8e5..8a4d52a9028d 100644
@@ -379,6 +379,8 @@ static int isst_if_cpu_online(unsigned int cpu)
 	u64 data;
 	int ret;
 
+	isst_cpu_info[cpu].numa_node = cpu_to_node(cpu);
+
 	ret = rdmsrl_safe(MSR_CPU_BUS_NUMBER, &data);
 	if (ret) {
 		/* This is not a fatal error on MSR mailbox only I/F */
@@ -397,7 +399,6 @@ static int isst_if_cpu_online(unsigned int cpu)
 		return ret;
 	}
 	isst_cpu_info[cpu].punit_cpu_id = data;
-	isst_cpu_info[cpu].numa_node = cpu_to_node(cpu);
 
 	isst_restore_msr_local(cpu);
 
Signature · 1 line
2.31.1
#1 lore raw

Hi,

Quoted 7 lines · Srinivas Pandruvada

When numa is used to map CPU to PCI device, the optimized path to read from cached data is not working and still calls _isst_if_get_pci_dev().

The reason is that when caching the mapping, numa information is not available as it is read later. So move the assignment of isst_cpu_info[cpu].numa_node before calling _isst_if_get_pci_dev().

Quoted 5 lines
Fixes aa2ddd242572 ("platform/x86: ISST: Use numa node id for cpu pci dev mapping")

---
v2:
Fixed "Fixes tag" as suggested by Stephen Rothwell

Thanks, but I just fixed this myself in the pdx86/for-next tree and I've done a forced-push of for-next with the fixed Fixes tag.

Either way this is resolved now :)

Regards,

Hans

Quoted 31 lines

Update:
The fixes tag was wrong
This patch can wait for next merge window as these systems are not shipped.

 drivers/platform/x86/intel_speed_select_if/isst_if_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/x86/intel_speed_select_if/isst_if_common.c +2 -1
index 6f0cc679c8e5..8a4d52a9028d 100644
@@ -379,6 +379,8 @@ static int isst_if_cpu_online(unsigned int cpu)
 	u64 data;
 	int ret;
 
+	isst_cpu_info[cpu].numa_node = cpu_to_node(cpu);
+
 	ret = rdmsrl_safe(MSR_CPU_BUS_NUMBER, &data);
 	if (ret) {
 		/* This is not a fatal error on MSR mailbox only I/F */
@@ -397,7 +399,6 @@ static int isst_if_cpu_online(unsigned int cpu)
 		return ret;
 	}
 	isst_cpu_info[cpu].punit_cpu_id = data;
-	isst_cpu_info[cpu].numa_node = cpu_to_node(cpu);
 
 	isst_restore_msr_local(cpu);