Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: pcrypt - Use the online cpumask as the default

We use the active cpumask to determine the superset of cpus
to use for parallelization. However, the active cpumask is
for internal usage of the scheduler and therefore not the
appropriate cpumask for these purposes. So use the online
cpumask instead.

Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Steffen Klassert and committed by
Herbert Xu
fbf0ca1b 96120905

+4 -4
+4 -4
crypto/pcrypt.c
··· 280 280 281 281 ictx->tfm_count++; 282 282 283 - cpu_index = ictx->tfm_count % cpumask_weight(cpu_active_mask); 283 + cpu_index = ictx->tfm_count % cpumask_weight(cpu_online_mask); 284 284 285 - ctx->cb_cpu = cpumask_first(cpu_active_mask); 285 + ctx->cb_cpu = cpumask_first(cpu_online_mask); 286 286 for (cpu = 0; cpu < cpu_index; cpu++) 287 - ctx->cb_cpu = cpumask_next(ctx->cb_cpu, cpu_active_mask); 287 + ctx->cb_cpu = cpumask_next(ctx->cb_cpu, cpu_online_mask); 288 288 289 289 cipher = crypto_spawn_aead(crypto_instance_ctx(inst)); 290 290 ··· 472 472 goto err_free_padata; 473 473 } 474 474 475 - cpumask_and(mask->mask, cpu_possible_mask, cpu_active_mask); 475 + cpumask_and(mask->mask, cpu_possible_mask, cpu_online_mask); 476 476 rcu_assign_pointer(pcrypt->cb_cpumask, mask); 477 477 478 478 pcrypt->nblock.notifier_call = pcrypt_cpumask_change_notify;