netdev
[Top] [All Lists]

Re: Asynchronous crypto layer.

To: jamal <hadi@xxxxxxxxxx>, James Morris <jmorris@xxxxxxxxxx>, Michal Ludvig <michal@xxxxxxxx>
Subject: Re: Asynchronous crypto layer.
From: Evgeniy Polyakov <johnpol@xxxxxxxxxxx>
Date: Tue, 2 Nov 2004 18:24:15 +0300
Cc: netdev@xxxxxxxxxxx, cryptoapi@xxxxxxxxxxxxxx
In-reply-to: <1099030958.4944.148.camel@uganda>
Organization: MIPT
References: <1099030958.4944.148.camel@uganda>
Sender: netdev-bounce@xxxxxxxxxxx
Here we go.
Numbers.

Actually nothing excitement:
since ecryption/decryption was made in a one thread
(please see dirty hack in sync_provider.c:89 to allow
crypto_cipher_{en,de}crypt() work in _bh context, BUG()
in crypto_yeld() can be reproduced by removing hack).

UP with HT badly broken Xeon(800 mhz) 2 parallel running scripts:
rnd=$RANDOM
file=/mnt/$rnd

for ((i=0; i<20; ++i)); do
        echo -en "."
        dd if=/dev/zero of=$file bs=1M count=40 > /dev/null 2>&1
        rm -f $file
done
echo

Pure sync mode: 
0.07user 14.87system 0:16.49elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+6840minor)pagefaults 0swaps

Pseudo async mode(data ecnryption/decryption is done synchronous thread,
only pre/post processing is asynchronous):
0.08user 11.66system 0:17.03elapsed 68%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+6870minor)pagefaults 0swaps

Attached synchronous and asynchronous crypto providers and purely in-memory 
block device.
Usage:
Async mode:
cd crypto
sudo ./i
cd ../block
sudo ./i
term1$ sudo time ./start
term2$ sudo time ./start

Sync mode:
cd block
sudo ./r
cd ../crypto
sudo ./r
cd ../block
sudo ./i 1
term1$ sudo time ./start
term2$ sudo time ./start

I will send updated asynchronous crypto patch in a next e-mail.

        Evgeniy Polyakov

Only failure makes us experts. -- Theo de Raadt

Attachment: async_provider.c
Description: Text Data

Attachment: Makefile
Description: Binary data

Attachment: bd.c
Description: Text Data

Attachment: i
Description: Binary data

Attachment: r
Description: Binary data

Attachment: sync_provider.c
Description: Text Data

Attachment: start
Description: Binary data

<Prev in Thread] Current Thread [Next in Thread>