Whamcloud - gitweb
LU-15003 sec: use enc pool for bounce pages 49/47149/11
authorSebastien Buisson <sbuisson@ddn.com>
Fri, 25 Mar 2022 08:24:32 +0000 (09:24 +0100)
committerOleg Drokin <green@whamcloud.com>
Thu, 1 Sep 2022 05:52:52 +0000 (05:52 +0000)
commitf3fe144b8572e9e75bb55076e29057227476ebf5
tree91e2ccaa3539337b3c20cd23f5b27ffe4277a550
parent9ca348e8769d2c613082eeaeaf2775e22625e970
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
Reviewed-on: https://review.whamcloud.com/47149
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
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