Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Milan Broz <gmazyland@gmail.com>
To: Gilad Ben-Yossef <gilad@benyossef.com>,
	dm-devel@redhat.com, Alasdair Kergon <agk@redhat.com>,
	MIKE Snitzer <snitzer@redhat.com>
Cc: linux-crypto@vger.kernel.org, gilad.benyossef@arm.com,
	"Ofir Drang" <ofir.drang@arm.com>,
	"Eric Biggers" <ebiggers3@gmail.com>,
	"Ondrej Mosnáček" <omosnacek+linux-crypto@gmail.com>
Subject: Re: [PATCH v3] dm: switch dm-verity to async hash crypto API
Date: Mon, 20 Feb 2017 13:51:24 +0100	[thread overview]
Message-ID: <1e21d973-b345-54a9-8115-cc3e30364051@gmail.com> (raw)
In-Reply-To: <1487508367-16036-1-git-send-email-gilad@benyossef.com>

On 02/19/2017 01:46 PM, Gilad Ben-Yossef wrote:
> Use of the synchronous digest API limits dm-verity to using pure
> CPU based algorithm providers and rules out the use of off CPU
> algorithm providers which are normally asynchronous by nature,
> potentially freeing CPU cycles.
> 
> This can reduce performance per Watt in situations such as during
> boot time when a lot of concurrent file accesses are made to the
> protected volume.
> 
> Move DM_VERITY to the asynchronous hash API.
> 
> Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
> CC: Eric Biggers <ebiggers3@gmail.com>
> CC: Ondrej Mosnáček <omosnacek+linux-crypto@gmail.com>
> CC: Milan Broz <gmazyland@gmail.com>
> ---
> 
> The patch was tested on an Armv7 based dual core Zynq ZC706 development
> board with SHA256-asm, SHA256-neon synchronous providers with no visible
> degradation of performance, with cryptd based asynchronous versions of the 
> same and with an off tree Arm CryptoCell asynchronous provider.
> 
> Changes from v2:
> 
> - Use completion to potentially wait also on crypto_ahash_init() as it
>   may finish asynchronously as well in some drivers, such as cryptd, as
>   discovered by Milan Broz.

This version survived my simple veritysetup test (in cryptsetup package)
with forced async path so I think it is ok for 4.12 queue...

Thanks,
Milan


> - Use sg_init_one() where apropriate as pointed out by Milan Broz.
> 
> Changes from v1:
> 
> - Use a 0 mask to allocate crypto alg indicating we welcome async algo 
>   providers, as suggested by Ondrej Mosnáček.
> - Fix use of un-initialized completion when using async provider for IO
>   blocks hashing
> - Pass flag indicating we are OK with crypto provider backlog
> - Re-factor checking for need to wait into a common function
> 

      reply	other threads:[~2017-02-20 12:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-19 12:46 [PATCH v3] dm: switch dm-verity to async hash crypto API Gilad Ben-Yossef
2017-02-20 12:51 ` Milan Broz [this message]

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=1e21d973-b345-54a9-8115-cc3e30364051@gmail.com \
    --to=gmazyland@gmail.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=ebiggers3@gmail.com \
    --cc=gilad.benyossef@arm.com \
    --cc=gilad@benyossef.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=ofir.drang@arm.com \
    --cc=omosnacek+linux-crypto@gmail.com \
    --cc=snitzer@redhat.com \
    /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