From: Steffen Klassert <steffen.klassert@secunet.com>
To: Mandeep Singh Baines <msb@chromium.org>
Cc: Alasdair G Kergon <agk@redhat.com>,
dm-devel@redhat.com, Will Drewry <wad@chromium.org>,
Elly Jones <ellyjones@chromium.org>,
Milan Broz <mbroz@redhat.com>,
Olof Johansson <olofj@chromium.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] dm: verity target
Date: Tue, 15 Nov 2011 10:19:22 +0100 [thread overview]
Message-ID: <20111115091922.GC20943@secunet.com> (raw)
In-Reply-To: <20111114175423.GA13132@google.com>
Hi.
On Mon, Nov 14, 2011 at 09:54:23AM -0800, Mandeep Singh Baines wrote:
>
> Hi Steffen,
>
> We use a hash per CPU to avoid allocating and freeing a context per
> computation. We could allocate the context on the stack as you suggest.
> However, we were worried about overflowing the stack. The context can be
> quite large (close to 200 bytes for sha512).
Indeed, but preallocating on percpu basis can be also quite large on
bigsmp machines.
>
> We use a hash per CPU because there can be at most one hash in progress
> on each CPU at any one time.
>
Ok, this is the case because you use a workqueue and this processes
at most one work item on each cpu the time.
On another note, you might want to use ahash here. Most crypto hardware
accelerators need to use asynchronous ciphers. These can't be used if
you use the synchronous interface.
And at the latest when you switch to ahash, you need more than one
preallocated ahash request on each cpu, as there can be many ahash
requests submitted on each cpu :)
next prev parent reply other threads:[~2011-11-15 9:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-10 5:18 [PATCH] dm: verity target Mandeep Singh Baines
2011-11-10 5:18 ` Mandeep Singh Baines
2011-11-10 7:44 ` Steffen Klassert
2011-11-10 14:42 ` Will Drewry
2011-11-11 17:34 ` [PATCH v2] " Mandeep Singh Baines
2011-11-11 17:34 ` Mandeep Singh Baines
2011-11-14 9:22 ` Steffen Klassert
2011-11-14 17:54 ` Mandeep Singh Baines
2011-11-15 9:19 ` Steffen Klassert [this message]
2011-11-22 22:15 ` Mandeep Singh Baines
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=20111115091922.GC20943@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=ellyjones@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mbroz@redhat.com \
--cc=msb@chromium.org \
--cc=olofj@chromium.org \
--cc=wad@chromium.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.