[dm-devel] [PATCH 02/20] dm-crypt: use unbound workqueue for request processing

Mikulas Patocka mpatocka at redhat.com
Tue Aug 21 09:09:13 UTC 2012


Use unbound workqueue so that work is automatically ballanced between
available CPUs.

Note: workqueue implementation is somehow buggy, so it still does not yield
full parallelization across multiple CPUs.

Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>
---
 drivers/md/dm-crypt.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 7a3e8eb..4c8b4e0 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1649,8 +1649,9 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 	cc->crypt_queue = alloc_workqueue("kcryptd",
 					  WQ_NON_REENTRANT|
 					  WQ_CPU_INTENSIVE|
-					  WQ_MEM_RECLAIM,
-					  1);
+					  WQ_MEM_RECLAIM|
+					  WQ_UNBOUND,
+					  num_online_cpus());
 	if (!cc->crypt_queue) {
 		ti->error = "Couldn't create kcryptd queue";
 		goto bad;
-- 
1.7.10.4




More information about the dm-devel mailing list