From: Herbert Xu <herbert@gondor.apana.org.au>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Eric Biggers <ebiggers@kernel.org>,
Steffen Klassert <steffen.klassert@secunet.com>,
netdev@vger.kernel.org, linux-crypto@vger.kernel.org,
fsverity@lists.linux.dev, dm-devel@lists.linux.dev,
x86@kernel.org, linux-arm-kernel@lists.infradead.org,
Sami Tolvanen <samitolvanen@google.com>,
Bart Van Assche <bvanassche@acm.org>,
Tim Chen <tim.c.chen@linux.intel.com>
Subject: Re: [PATCH v4 6/8] fsverity: improve performance by using multibuffer hashing
Date: Thu, 6 Jun 2024 16:08:17 +0800 [thread overview]
Message-ID: <ZmFucW37DI6P6iYL@gondor.apana.org.au> (raw)
In-Reply-To: <CAMj1kXFt_E9ghN7GfpYHR4-yaLsz_J-D1Nc3XsVqUamZ6yXHGQ@mail.gmail.com>
On Thu, Jun 06, 2024 at 09:55:56AM +0200, Ard Biesheuvel wrote:
>
> So again, how would that work for ahash falling back to shash. Are you
> saying every existing shash implementation should be duplicated into
> an ahash so that the multibuffer optimization can be added? shash is a
> public interface so we cannot just remove the existing ones and we'll
> end up carrying both forever.
It should do the same thing for ahash algorithms that do not support
multiple requests. IOW it should process the requests one by one.
> Sure, but the block I/O world is very different. Forcing it to use an
> API modeled after how IPsec might use it seems, again, unreasonable.
It's not different at all. You can see that by the proliferation
of kmap calls in fs/verity. It's a fundamental issue. You can't
consistently get a large contiguous allocation beyond one page due
to fragmentation. So large data is always going to be scattered.
BTW, I'm all for elminating the overhead when you already have a
linear address for scattered memory, e.g., through vmalloc. We
should definitely improve our interface for ahash/skcipher/aead so
that vmalloc addresses (as well as kmalloc virtual addresses by
extension) are supported as first class citizens, and we don't turn
them into SG lists unless it's necessary for DMA.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
WARNING: multiple messages have this Message-ID (diff)
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Eric Biggers <ebiggers@kernel.org>,
Steffen Klassert <steffen.klassert@secunet.com>,
netdev@vger.kernel.org, linux-crypto@vger.kernel.org,
fsverity@lists.linux.dev, dm-devel@lists.linux.dev,
x86@kernel.org, linux-arm-kernel@lists.infradead.org,
Sami Tolvanen <samitolvanen@google.com>,
Bart Van Assche <bvanassche@acm.org>,
Tim Chen <tim.c.chen@linux.intel.com>
Subject: Re: [PATCH v4 6/8] fsverity: improve performance by using multibuffer hashing
Date: Thu, 6 Jun 2024 16:08:17 +0800 [thread overview]
Message-ID: <ZmFucW37DI6P6iYL@gondor.apana.org.au> (raw)
In-Reply-To: <CAMj1kXFt_E9ghN7GfpYHR4-yaLsz_J-D1Nc3XsVqUamZ6yXHGQ@mail.gmail.com>
On Thu, Jun 06, 2024 at 09:55:56AM +0200, Ard Biesheuvel wrote:
>
> So again, how would that work for ahash falling back to shash. Are you
> saying every existing shash implementation should be duplicated into
> an ahash so that the multibuffer optimization can be added? shash is a
> public interface so we cannot just remove the existing ones and we'll
> end up carrying both forever.
It should do the same thing for ahash algorithms that do not support
multiple requests. IOW it should process the requests one by one.
> Sure, but the block I/O world is very different. Forcing it to use an
> API modeled after how IPsec might use it seems, again, unreasonable.
It's not different at all. You can see that by the proliferation
of kmap calls in fs/verity. It's a fundamental issue. You can't
consistently get a large contiguous allocation beyond one page due
to fragmentation. So large data is always going to be scattered.
BTW, I'm all for elminating the overhead when you already have a
linear address for scattered memory, e.g., through vmalloc. We
should definitely improve our interface for ahash/skcipher/aead so
that vmalloc addresses (as well as kmalloc virtual addresses by
extension) are supported as first class citizens, and we don't turn
them into SG lists unless it's necessary for DMA.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-06-06 8:08 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-03 18:37 [PATCH v4 0/8] Optimize dm-verity and fsverity using multibuffer hashing Eric Biggers
2024-06-03 18:37 ` Eric Biggers
2024-06-03 18:37 ` [PATCH v4 1/8] crypto: shash - add support for finup_mb Eric Biggers
2024-06-03 18:37 ` Eric Biggers
2024-06-04 18:55 ` Ard Biesheuvel
2024-06-04 18:55 ` Ard Biesheuvel
2024-06-04 19:25 ` Eric Biggers
2024-06-04 19:25 ` Eric Biggers
2024-06-03 18:37 ` [PATCH v4 2/8] crypto: testmgr - generate power-of-2 lengths more often Eric Biggers
2024-06-03 18:37 ` Eric Biggers
2024-06-03 18:37 ` [PATCH v4 3/8] crypto: testmgr - add tests for finup_mb Eric Biggers
2024-06-03 18:37 ` Eric Biggers
2024-06-03 18:37 ` [PATCH v4 4/8] crypto: x86/sha256-ni - add support " Eric Biggers
2024-06-03 18:37 ` Eric Biggers
2024-06-03 18:37 ` [PATCH v4 5/8] crypto: arm64/sha256-ce " Eric Biggers
2024-06-03 18:37 ` Eric Biggers
2024-06-04 19:00 ` Ard Biesheuvel
2024-06-04 19:00 ` Ard Biesheuvel
2024-06-03 18:37 ` [PATCH v4 6/8] fsverity: improve performance by using multibuffer hashing Eric Biggers
2024-06-03 18:37 ` Eric Biggers
2024-06-04 9:37 ` Herbert Xu
2024-06-04 9:37 ` Herbert Xu
2024-06-04 18:42 ` Eric Biggers
2024-06-04 18:42 ` Eric Biggers
2024-06-05 9:19 ` Herbert Xu
2024-06-05 9:19 ` Herbert Xu
2024-06-05 9:22 ` Herbert Xu
2024-06-05 9:22 ` Herbert Xu
2024-06-05 9:46 ` Herbert Xu
2024-06-05 9:46 ` Herbert Xu
2024-06-05 19:14 ` Eric Biggers
2024-06-05 19:14 ` Eric Biggers
2024-06-06 2:00 ` Herbert Xu
2024-06-06 2:00 ` Herbert Xu
2024-06-06 5:28 ` Eric Biggers
2024-06-06 5:28 ` Eric Biggers
2024-06-06 5:41 ` Herbert Xu
2024-06-06 5:41 ` Herbert Xu
2024-06-06 6:58 ` Ard Biesheuvel
2024-06-06 6:58 ` Ard Biesheuvel
2024-06-06 7:34 ` Herbert Xu
2024-06-06 7:34 ` Herbert Xu
2024-06-06 7:55 ` Ard Biesheuvel
2024-06-06 7:55 ` Ard Biesheuvel
2024-06-06 8:08 ` Herbert Xu [this message]
2024-06-06 8:08 ` Herbert Xu
2024-06-06 8:33 ` Ard Biesheuvel
2024-06-06 8:33 ` Ard Biesheuvel
2024-06-06 9:15 ` Herbert Xu
2024-06-06 9:15 ` Herbert Xu
2024-06-10 16:42 ` Eric Biggers
2024-06-10 16:42 ` Eric Biggers
2024-06-11 15:21 ` Herbert Xu
2024-06-11 15:21 ` Herbert Xu
2024-06-11 15:39 ` Herbert Xu
2024-06-11 15:39 ` Herbert Xu
2024-06-11 20:32 ` Eric Biggers
2024-06-11 15:46 ` Ard Biesheuvel
2024-06-11 15:46 ` Ard Biesheuvel
2024-06-11 15:51 ` Herbert Xu
2024-06-11 15:51 ` Herbert Xu
2024-06-11 20:18 ` Eric Biggers
2024-06-05 18:58 ` Eric Biggers
2024-06-05 18:58 ` Eric Biggers
2024-06-03 18:37 ` [PATCH v4 7/8] dm-verity: hash blocks with shash import+finup when possible Eric Biggers
2024-06-03 18:37 ` Eric Biggers
2024-06-03 18:37 ` [PATCH v4 8/8] dm-verity: improve performance by using multibuffer hashing Eric Biggers
2024-06-03 18:37 ` 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=ZmFucW37DI6P6iYL@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=ardb@kernel.org \
--cc=bvanassche@acm.org \
--cc=dm-devel@lists.linux.dev \
--cc=ebiggers@kernel.org \
--cc=fsverity@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=samitolvanen@google.com \
--cc=steffen.klassert@secunet.com \
--cc=tim.c.chen@linux.intel.com \
--cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.