summaryrefslogtreecommitdiff
path: root/crypto/pcrypt.c
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2012-03-28 08:51:03 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2012-03-29 19:52:47 +0800
commit2c6abb34e838014f57f839375947dcd4ee7967bb (patch)
tree7850bd96ca18f600830a9ff75f07f8a634d6d14f /crypto/pcrypt.c
parent180f8e414832acf3b03b56771effa415926bd43a (diff)
downloadlinux-crypto-2c6abb34e838014f57f839375947dcd4ee7967bb.tar.gz
linux-crypto-2c6abb34e838014f57f839375947dcd4ee7967bb.zip
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>
Diffstat (limited to 'crypto/pcrypt.c')
-rw-r--r--crypto/pcrypt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c
index 29a89dad..b2c99dc1 100644
--- a/crypto/pcrypt.c
+++ b/crypto/pcrypt.c
@@ -280,11 +280,11 @@ static int pcrypt_aead_init_tfm(struct crypto_tfm *tfm)
ictx->tfm_count++;
- cpu_index = ictx->tfm_count % cpumask_weight(cpu_active_mask);
+ cpu_index = ictx->tfm_count % cpumask_weight(cpu_online_mask);
- ctx->cb_cpu = cpumask_first(cpu_active_mask);
+ ctx->cb_cpu = cpumask_first(cpu_online_mask);
for (cpu = 0; cpu < cpu_index; cpu++)
- ctx->cb_cpu = cpumask_next(ctx->cb_cpu, cpu_active_mask);
+ ctx->cb_cpu = cpumask_next(ctx->cb_cpu, cpu_online_mask);
cipher = crypto_spawn_aead(crypto_instance_ctx(inst));
@@ -472,7 +472,7 @@ static int pcrypt_init_padata(struct padata_pcrypt *pcrypt,
goto err_free_padata;
}
- cpumask_and(mask->mask, cpu_possible_mask, cpu_active_mask);
+ cpumask_and(mask->mask, cpu_possible_mask, cpu_online_mask);
rcu_assign_pointer(pcrypt->cb_cpumask, mask);
pcrypt->nblock.notifier_call = pcrypt_cpumask_change_notify;