Whamcloud - gitweb
LU-15003 sec: use enc pool for bounce pages 49/47149/9
authorSebastien Buisson <sbuisson@ddn.com>
Fri, 25 Mar 2022 08:24:32 +0000 (09:24 +0100)
committerSebastien Buisson <sbuisson@ddn.com>
Thu, 30 Jun 2022 13:26:57 +0000 (15:26 +0200)
commitb97f076b7489bf4e6d4bfdefaa4e27308620d33d
treebce7616d337deb0115bebafd2df9f10093debab3
parentf76a926f59e75b743b1c638308d923275b87539b
LU-15003 sec: use enc pool for bounce pages

Take pages from the enc pool so that they can be used for
encryption, instead of letting llcrypt allocate a bounce page
for every call to the encryption primitives.
Pages are taken from the enc pool a whole array at a time.

This requires modifying the llcrypt API, so that new functions
llcrypt_encrypt_page() and llcrypt_decrypt_page() are exported.
These functions take a destination page parameter.
Until this change is pushed in upstream fscrypt, this performance
optimization is not available when Lustre is built and run against
the in-kernel fscrypt lib.

Using enc pool for bounce pages is a worthwhile performance win. Here
are performance penalties incurred by encryption, without this patch,
and with this patch:

                     ||=====================|=====================||
                     || Performance penalty | Performance penalty ||
                     ||    without patch    |     with patch      ||
||==========================================|=====================||
|| Bandwidth – write |        30%-35%       |   5%-10% large IOs  ||
||                   |                      |    15% small IOs    ||
||------------------------------------------|---------------------||
|| Bandwidth – read  |         20%          |    less than 10%    ||
||------------------------------------------|---------------------||
||      Metadata     |         N/A          |         5%          ||
|| creat,stat,remove |                      |                     ||
||==========================================|=====================||

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Change-Id: I3078d0a3349b3d24acc5e61ab53ac434b5f9d0e3
libcfs/include/libcfs/crypto/llcrypt.h
libcfs/libcfs/crypto/crypto.c
lustre/include/lustre_crypto.h
lustre/include/lustre_sec.h
lustre/llite/dir.c
lustre/osc/osc_request.c
lustre/ptlrpc/sec_bulk.c