mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Milan Broz <gmazyland@gmail.com>
To: Eric Biggers <ebiggers@kernel.org>,
	dm-devel@lists.linux.dev, Alasdair Kergon <agk@redhat.com>,
	Mike Snitzer <snitzer@kernel.org>,
	Mikulas Patocka <mpatocka@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	Gilad Ben-Yossef <gilad@benyossef.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Sami Tolvanen <samitolvanen@google.com>
Subject: Re: [PATCH v2] dm-verity: remove support for asynchronous hashes
Date: Thu, 10 Jul 2025 10:28:55 +0200	[thread overview]
Message-ID: <1ee8338a-b19a-409a-bbe6-2068893b8abc@gmail.com> (raw)
In-Reply-To: <20250709190902.49554-1-ebiggers@kernel.org>

On 7/9/25 9:09 PM, Eric Biggers wrote:
> The support for asynchronous hashes in dm-verity has outlived its
> usefulness.  It adds significant code complexity and opportunity for
> bugs.  I don't know of anyone using it in practice.  (The original
> submitter of the code possibly was, but that was 8 years ago.)  Data I
> recently collected for en/decryption shows that using off-CPU crypto
> "accelerators" is consistently much slower than the CPU
> (https://lore.kernel.org/r/20250704070322.20692-1-ebiggers@kernel.org/),
> even on CPUs that lack dedicated cryptographic instructions.  Similar
> results are likely to be seen for hashing.
> 
> I already removed support for asynchronous hashes from fsverity two
> years ago, and no one ever complained.
> 
> Moreover, neither dm-verity, fsverity, nor fscrypt has ever actually
> used the asynchronous crypto algorithms in a truly asynchronous manner.
> The lack of interest in such optimizations provides further evidence
> that it's only the CPU-based crypto that actually matters.
> 
> Historically, it's also been common for people to forget to enable the
> optimized SHA-256 code, which could contribute to an off-CPU crypto
> engine being perceived as more useful than it really is.  In 6.16 I
> fixed that: the optimized SHA-256 code is now enabled by default.
> 
> Therefore, let's drop the support for asynchronous hashes in dm-verity.
> 
> Tested with verity-compat-test.

Hi,

I shortly tested it with veritysetup too, also on 32bit.
And I like this patch (I wish we can remove the async thing from the dmcrypt too...)

Just one nitpick - could you please increase minor version of dm-verity target,
so we have information in debug log that it is a patched version?

Thanks,
Milan

> 
> Acked-by: Ard Biesheuvel <ardb@kernel.org>
> Signed-off-by: Eric Biggers <ebiggers@kernel.org>
> ---
> 
> Changed in v2:
>    - Removed the now-unused 'may_sleep' parameter from verity_hash()
>    - Fixed a typo in commit message
>    - Added comment in verity_setup_salt_and_hashstate()
>    - Keep SHASH_DESC_ON_STACK in existing place in
>      verity_setup_salt_and_hashstate(), to reduce the diff slightly
>    - Added Ard's Acked-by
> 
>   drivers/md/dm-verity-fec.c    |   4 +-
>   drivers/md/dm-verity-target.c | 183 ++++++----------------------------
>   drivers/md/dm-verity.h        |  22 ++--
>   3 files changed, 37 insertions(+), 172 deletions(-)

  reply	other threads:[~2025-07-10  8:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-09 19:09 Eric Biggers
2025-07-10  8:28 ` Milan Broz [this message]
2025-07-10 15:55   ` Bart Van Assche
2025-07-10 16:04     ` Eric Biggers
2025-07-10 16:18     ` Milan Broz
2025-07-10 16:10   ` Eric Biggers
2025-07-10 19:38     ` Milan Broz
2025-07-10 18:08   ` Eric Biggers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1ee8338a-b19a-409a-bbe6-2068893b8abc@gmail.com \
    --to=gmazyland@gmail.com \
    --cc=Jason@zx2c4.com \
    --cc=agk@redhat.com \
    --cc=ardb@kernel.org \
    --cc=dm-devel@lists.linux.dev \
    --cc=ebiggers@kernel.org \
    --cc=gilad@benyossef.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=samitolvanen@google.com \
    --cc=snitzer@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®