History

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.

Steffen Klassert committed 14 years ago

Commit fbf0ca11 parent 96120901 file · +4 −4Browse files

Showing the changes to crypto/pcrypt.c (1 of 1 file). Show all

Unified · Split

crypto/pcrypt.c+4−4
@@ -280,11 +280,11 @@ static int pcrypt_aead_init_tfm(struct crypto_tfm *tfm) · 279 unmodified lines
280280
281281 ictx->tfm_count++;
282282
283− cpu_index = ictx->tfm_count % cpumask_weight(cpu_active_mask);
283+ cpu_index = ictx->tfm_count % cpumask_weight(cpu_online_mask);
284284
285− ctx->cb_cpu = cpumask_first(cpu_active_mask);
285+ ctx->cb_cpu = cpumask_first(cpu_online_mask);
286286 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);
288288
289289 cipher = crypto_spawn_aead(crypto_instance_ctx(inst));
290290
@@ -472,7 +472,7 @@ static int pcrypt_init_padata(struct padata_pcrypt *pcrypt, · 181 unmodified lines
472472 goto err_free_padata;
473473 }
474474
475− cpumask_and(mask->mask, cpu_possible_mask, cpu_active_mask);
475+ cpumask_and(mask->mask, cpu_possible_mask, cpu_online_mask);
476476 rcu_assign_pointer(pcrypt->cb_cpumask, mask);
477477
478478 pcrypt->nblock.notifier_call = pcrypt_cpumask_change_notify;