[lkml]   [2012]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 02/10] random: use lockless techniques when mixing entropy pools
On Thu, 2012-07-05 at 15:47 -0400, Theodore Ts'o wrote:
> On Thu, Jul 05, 2012 at 02:10:12PM -0500, Matt Mackall wrote:
> >
> > I don't think this will work correctly. It's important that simultaneous
> > _readers_ of the state get different results. Otherwise, you can get
> > things like duplicate UUIDs generated on different cores, something
> > that's been observed in the field(!). I thought I added a comment to
> > that effect some years back, but I guess not.
> That's easy to fix; we just need to take a spinlock on the extract
> side. The main issue is that Thomas very much doesn't want us to take
> a spinlock in the interrupt handler codepath. But if we take a
> spinlock while extracting, that should take care of this concern.

Yup. This is why there's a separate _extract function to start with,
though this particular optimization hadn't been made yet. You do need to
continue to be sure to do the mix and extract in one operation though.

Mathematics is the supreme nostalgia of our time.

 \ /
  Last update: 2012-07-06 01:21    [W:0.054 / U:33.360 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site