Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH] crypto: pcrypt - Use the online cpumask as the default
@ 2012-03-28  6:51 Steffen Klassert
  2012-03-30  9:21 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Steffen Klassert @ 2012-03-28  6:51 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Peter Zijlstra, linux-crypto

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>
---
 crypto/pcrypt.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c
index 29a89da..b2c99dc 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;
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: pcrypt - Use the online cpumask as the default
  2012-03-28  6:51 [PATCH] crypto: pcrypt - Use the online cpumask as the default Steffen Klassert
@ 2012-03-30  9:21 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2012-03-30  9:21 UTC (permalink / raw)
  To: Steffen Klassert; +Cc: Peter Zijlstra, linux-crypto

On Wed, Mar 28, 2012 at 08:51:03AM +0200, Steffen Klassert wrote:
> 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>

Applied to crypto.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-30  9:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-28  6:51 [PATCH] crypto: pcrypt - Use the online cpumask as the default Steffen Klassert
2012-03-30  9:21 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox