lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 22 Nov 2011 14:15:14 -0800
From:	Mandeep Singh Baines <msb@...omium.org>
To:	Steffen Klassert <steffen.klassert@...unet.com>
Cc:	Mandeep Singh Baines <msb@...omium.org>,
	Alasdair G Kergon <agk@...hat.com>, dm-devel@...hat.com,
	Will Drewry <wad@...omium.org>,
	Elly Jones <ellyjones@...omium.org>,
	Milan Broz <mbroz@...hat.com>,
	Olof Johansson <olofj@...omium.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] dm: verity target

Hi Steffen,

Sorry for the delayed repsonse.

Steffen Klassert (steffen.klassert@...unet.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ