From: Mandeep Singh Baines <msb@chromium.org>
To: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Mandeep Singh Baines <msb@chromium.org>,
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, 22 Nov 2011 14:15:14 -0800 [thread overview]
Message-ID: <20111122221514.GC2096@google.com> (raw)
In-Reply-To: <20111115091922.GC20943@secunet.com>
Hi Steffen,
Sorry for the delayed repsonse.
Steffen Klassert (steffen.klassert@secunet.com) wrote:
> 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.
>
Yes, you'll consume NUM_CPUS*sizeof(context) but I'm not sure that its
a lot of memory relative to the total amount of memory you'd see on a
big SMP/NUMA system.
> >
> > 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.
>
We definitely want to look at ahash but I'd like to get the baseline
functionality in and then iterate. Do you think it would be cool
if we deferred looking into ahash until later?
> 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 :)
>
Thanks much for all the feedback.
Regards,
Mandeep
prev parent reply other threads:[~2011-11-22 22:15 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
2011-11-22 22:15 ` Mandeep Singh Baines [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=20111122221514.GC2096@google.com \
--to=msb@chromium.org \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=ellyjones@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mbroz@redhat.com \
--cc=olofj@chromium.org \
--cc=steffen.klassert@secunet.com \
--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.