[dm-devel] [PATCH] DM-CRYPT: Scale to multiple CPUs v3

Milan Broz mbroz at redhat.com
Wed Oct 20 14:20:44 UTC 2010



> any progress here?
> I would like to achieve some consensus and merge some version
> of patch to dm tree...
> Maybe with known problems if there is no better solution for now. 

I have to reply to myself:
this patch introduces apparent regressions in async crypto mode.

- Without per-cpu patch applied, the test script runs fine even
with >16 levels stacked devices, both in sync/forced async crypto

- With the per-cpu patch it seems to deadlocks if the stacked
devices level is more than 16 levels, even in crypto sync mode

- With added force async patch below it deadlocks even for
10 level stacked device (maybe even less)

Tested on VM with 256M RAM and Linus' tree from today...

But is it possible that there is another problem related.

You can easily test it using this patch, which forces dmcrypt to use
cryptd (thus async crypto):

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 88a2a05..1d8ddc1 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1267,7 +1267,7 @@ static int crypt_ctr_cipher(struct dm_target *ti,
 		goto bad_mem;
 
 	ret = snprintf(cipher_api, CRYPTO_MAX_ALG_NAME,
-		       "%s(%s)", chainmode, cipher);
+		       "cryptd(%s(%s-generic))", chainmode, cipher);
 	if (ret < 0) {
 		kfree(cipher_api);
 		goto bad_mem;


And this test script (maybe some parameters mangling needed):

#!/bin/bash

DEVICE=/dev/sde
NUM=10

echo xxx | cryptsetup create -c aes-xts-plain64 -s 256 CTEST1 $DEVICE
for i in $(seq 1 $NUM); do
	j=$i
	i=$(($i + 1))
	echo xxx | cryptsetup create -c aes-xts-plain64 -s 256 CTEST$i /dev/mapper/CTEST$j
done

NUM=$(($NUM + 1))

dd if=/dev/zero of=/dev/mapper/CTEST$NUM bs=512 count=102400

for i in $(seq $NUM -1 1); do
	dmsetup remove CTEST$i
done


Milan





More information about the dm-devel mailing list