linux/drivers/crypto/intel/iaa
Yury Norov 714ca27e9b crypto: iaa - Optimize rebalance_wq_table()
The function opencodes for_each_cpu() by using a plain for-loop. The
loop calls cpumask_weight() inside the conditional section. Because
cpumask_weight() is O(1), the overall complexity of the function is
O(node * node_cpus^2). Also, cpumask_nth() internally calls hweight(),
which, if not hardware accelerated, is slower than cpumask_next() in
for_each_cpu().

If switched to the dedicated for_each_cpu(), the rebalance_wq_table()
can drop calling cpumask_weight(), together with some housekeeping code.
This makes the overall complexity O(node * node_cpus), or simply speaking
O(nr_cpu_ids).

While there, fix opencoded for_each_possible_cpu() too.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2025-05-14 17:45:22 +08:00
..
iaa_crypto_comp_fixed.c crypto: iaa - Remove header table code 2024-01-26 16:39:32 +08:00
iaa_crypto_main.c crypto: iaa - Optimize rebalance_wq_table() 2025-05-14 17:45:22 +08:00
iaa_crypto_stats.c crypto: iaa - Change iaa statistics to atomic64_t 2024-04-02 10:49:38 +08:00
iaa_crypto_stats.h crypto: iaa - Remove comp/decomp delay statistics 2024-04-02 10:49:38 +08:00
iaa_crypto.h crypto: iaa - Change iaa statistics to atomic64_t 2024-04-02 10:49:38 +08:00
Kconfig crypto: iaa - Add IAA Compression Accelerator stats 2023-12-15 17:52:53 +08:00
Makefile module: Convert default symbol namespace to string literal 2024-12-03 08:22:25 -08:00