-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exclude cipher allocation time from benchmark
For each 1 MiB of data en/decrypted, 'cryptsetup benchmark' is setting up a new AF_ALG socket, which involves 4 system calls and is included in the data en/decryption time. With high-speed ciphers (e.g. VAES optimized AES-XTS) this can measure well over 10000 AF_ALG socket setups per second. This is not representative of dm-crypt, which only allocates a cipher when the dm-crypt device is created. Therefore, allocate the AF_ALG socket once, before doing the benchmark. On AMD Ryzen 9 9950X this increases the 'cryptsetup benchmark' result of AES-256-XTS slightly, from 14000 MiB/s to 14600 MiB/s. Note that an in-kernel benchmark of the crypto API with the same block size (65536 bytes) gives 34100 MiB/s, so AF_ALG still takes more time than the en/decryption itself -- this cannot easily be addressed though. Signed-off-by: Eric Biggers <[email protected]>
- Loading branch information
Showing
1 changed file
with
23 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters