Skip to content

Commit

Permalink
crypto: mark crypto workqueues CPU_INTENSIVE
Browse files Browse the repository at this point in the history
kcrypto_wq and pcrypt->wq's are used to run ciphers and may consume
considerable amount of CPU cycles.  Mark both as CPU_INTENSIVE so that
they don't block other work items.

As the workqueues are primarily used to burn CPU cycles, concurrency
levels shouldn't matter much and are left at 1.  A higher value may be
beneficial and needs investigation.

Signed-off-by: Tejun Heo <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
htejun authored and herbertx committed Jan 4, 2011
1 parent 41f2977 commit c73b7d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion crypto/crypto_wq.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ EXPORT_SYMBOL_GPL(kcrypto_wq);

static int __init crypto_wq_init(void)
{
kcrypto_wq = create_workqueue("crypto");
kcrypto_wq = alloc_workqueue("crypto",
WQ_MEM_RECLAIM | WQ_CPU_INTENSIVE, 1);
if (unlikely(!kcrypto_wq))
return -ENOMEM;
return 0;
Expand Down
3 changes: 2 additions & 1 deletion crypto/pcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,8 @@ static int pcrypt_init_padata(struct padata_pcrypt *pcrypt,

get_online_cpus();

pcrypt->wq = create_workqueue(name);
pcrypt->wq = alloc_workqueue(name,
WQ_MEM_RECLAIM | WQ_CPU_INTENSIVE, 1);
if (!pcrypt->wq)
goto err;

Expand Down

0 comments on commit c73b7d0

Please sign in to comment.