diff options
| author | Eric Biggers <ebiggers@kernel.org> | 2025-10-15 00:16:55 +0300 |
|---|---|---|
| committer | Mikulas Patocka <mpatocka@redhat.com> | 2025-10-20 16:47:27 +0300 |
| commit | ba0f428c9b40364f1af92523860c787068987b8c (patch) | |
| tree | bccffbcfd67b96d321b0d5c487b2b5f95935cd58 /tools/docs/parse-headers.py | |
| parent | 3ee6c4bc5307d9fcc681dc7ee15822a54b94b39c (diff) | |
| download | linux-ba0f428c9b40364f1af92523860c787068987b8c.tar.xz | |
dm-verity: use SHA-256 library for SHA-256
When the hash algorithm is SHA-256 and the verity version is not 0, use
the SHA-256 library instead of crypto_shash.
This is a prerequisite for making dm-verity interleave the computation
of SHA-256 hashes for increased performance. That optimization is
available in the SHA-256 library but not in crypto_shash.
Even without interleaved hashing, switching to the library also slightly
improves performance by itself because it avoids the overhead of
crypto_shash, including indirect calls and other API overhead.
(Benchmark on x86_64, AMD Zen 5: hashing 4K blocks gets 2.1% faster.)
SHA-256 is by far the most common hash algorithm used with dm-verity.
It makes sense to optimize for the common case and fall back to the
generic crypto layer for uncommon cases, as suggested by Linus:
https://lore.kernel.org/r/CAHk-=wgp-fOSsZsYrbyzqCAfEvrt5jQs1jL-97Wc4seMNTUyng@mail.gmail.com
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Diffstat (limited to 'tools/docs/parse-headers.py')
0 files changed, 0 insertions, 0 deletions
