Skip to contentSkip to conversation

arm64: numa: Don't check node against MAX_NUMNODES

PATCH Applied Gavin Shan 2 participants 3 messages Jul 18, 2022 – Jul 19, 2022 arm64

lore
Share & tools
lore

Gavin Shan

author
#0 lore raw

PATCH 1/1 arm64: numa: Don't check node against MAX_NUMNODES

When the NUMA nodes are sorted by checking ACPI SRAT (GICC AFFINITY) sub-table, it's impossible for acpi_map_pxm_to_node() to return any value, which is greater than or equal to MAX_NUMNODES. Lets drop the unnecessary check in acpi_numa_gicc_affinity_init().

No functional change intended.

---
 arch/arm64/kernel/acpi_numa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/acpi_numa.c +1 -1
index fdfecf0991ce..e51535a5f939 100644
@@ -109,7 +109,7 @@ void __init acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa)
 	pxm = pa->proximity_domain;
 	node = acpi_map_pxm_to_node(pxm);
 
-	if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) {
+	if (node == NUMA_NO_NODE) {
 		pr_err("SRAT: Too many proximity domains %d\n", pxm);
 		bad_srat();
 		return;
Signature · 1 line
2.23.0
maintainer
#1 lore raw
Quoted 17 lines · Gavin Shan

When the NUMA nodes are sorted by checking ACPI SRAT (GICC AFFINITY) sub-table, it's impossible for acpi_map_pxm_to_node() to return any value, which is greater than or equal to MAX_NUMNODES. Lets drop the unnecessary check in acpi_numa_gicc_affinity_init().

No functional change intended.

---
 arch/arm64/kernel/acpi_numa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/acpi_numa.c +0 -0
index fdfecf0991ce..e51535a5f939 100644

arch/arm64/kernel/acpi_numa.c void __init acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa) · line 115

Quoted 8 lines
arch/arm64/kernel/acpi_numa.c +1 -1
@@ -109,7 +109,7 @@ void __init acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa)
 	pxm = pa->proximity_domain;
 	node = acpi_map_pxm_to_node(pxm);
 
-	if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) {
+	if (node == NUMA_NO_NODE) {
 		pr_err("SRAT: Too many proximity domains %d\n", pxm);
 		bad_srat();
 		return;

This isn't "obviously" correct, but it does look like the way in which acpi_map_pxm_to_node() allocates nodes in 'nodes_found_map' means that this check is redundant, so I'll pick it up.

Will

maintainer Applied
#2 lore raw
In reply to Gavin Shan
Quoted 8 lines · Gavin Shan

When the NUMA nodes are sorted by checking ACPI SRAT (GICC AFFINITY) sub-table, it's impossible for acpi_map_pxm_to_node() to return any value, which is greater than or equal to MAX_NUMNODES. Lets drop the unnecessary check in acpi_numa_gicc_affinity_init().

No functional change intended.

[...]

Applied to arm64 (for-next/misc), thanks!

[1/1] arm64: numa: Don't check node against MAX_NUMNODES

      https://git.kernel.org/arm64/c/9e26cac5f82b

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev