Skip to contentSkip to conversation

crypto: iaa - fix per-node CPU counter reset in rebalance_wq_table()

PATCH In review Giovanni Cabiddu 3 participants 3 messages Mar 24 – Apr 3

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

PATCH 1/1 crypto: iaa - fix per-node CPU counter reset in rebalance_wq_table()

The cpu counter used to compute the IAA device index is reset to zero at the start of each NUMA node iteration. This causes CPUs on every node to map starting from IAA index 0 instead of continuing from the previous node's last index. On multi-node systems, this results in all nodes mapping their CPUs to the same initial set of IAA devices, leaving higher-indexed devices unused.

Move the cpu counter initialization before the for_each_node_with_cpus() loop so that the IAA index computation accumulates correctly across all nodes.

Fixes 714ca27e9bf4 ("crypto: iaa - Optimize rebalance_wq_table()")
---
 drivers/crypto/intel/iaa/iaa_crypto_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/intel/iaa/iaa_crypto_main.c +1 -1
index 547abf453d4a..f62b994e18e5 100644
@@ -906,8 +906,8 @@ static void rebalance_wq_table(void)
 		return;
 	}
 
+	cpu = 0;
 	for_each_node_with_cpus(node) {
-		cpu = 0;
 		node_cpus = cpumask_of_node(node);
 
 		for_each_cpu(node_cpu, node_cpus) {
Signature · 1 line
2.53.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Giovanni Cabiddu

The cpu counter used to compute the IAA device index is reset to zero at the start of each NUMA node iteration. This causes CPUs on every node to map starting from IAA index 0 instead of continuing from the previous node's last index. On multi-node systems, this results in all nodes mapping their CPUs to the same initial set of IAA devices, leaving higher-indexed devices unused.

Quoted 7 lines

Move the cpu counter initialization before the for_each_node_with_cpus() loop so that the IAA index computation accumulates correctly across all nodes.

Fixes 714ca27e9bf4 ("crypto: iaa - Optimize rebalance_wq_table()")

---

Signature · 1 line
Vinicius
maintainer
#2 lore raw
In reply to Giovanni Cabiddu
Quoted 11 lines · Giovanni Cabiddu

The cpu counter used to compute the IAA device index is reset to zero at the start of each NUMA node iteration. This causes CPUs on every node to map starting from IAA index 0 instead of continuing from the previous node's last index. On multi-node systems, this results in all nodes mapping their CPUs to the same initial set of IAA devices, leaving higher-indexed devices unused.

Move the cpu counter initialization before the for_each_node_with_cpus() loop so that the IAA index computation accumulates correctly across all nodes.

Quoted 5 lines
Fixes 714ca27e9bf4 ("crypto: iaa - Optimize rebalance_wq_table()")
---
 drivers/crypto/intel/iaa/iaa_crypto_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt