[PATCH] optimize aio rw path
jra at samba.org
Thu Mar 27 12:11:31 MDT 2014
On Thu, Mar 27, 2014 at 11:28:58AM +0100, Volker Lendecke wrote:
> On Wed, Mar 26, 2014 at 09:32:37PM -0700, Jeremy Allison wrote:
> > On Wed, Mar 26, 2014 at 01:39:53PM +0100, Volker Lendecke wrote:
> > > Hi!
> > >
> > > Attached find a few patches that optimize our async I/O
> > > path. It might be a bit controversial, because it uses C99
> > > variable arrays. Here in this situation I think it really
> > > reduces code complexity and is important for performance.
> > >
> > > Review would be appreciated!
> > LGTM, pushed to autobuild. The only
> > thing that made me think a bit is
> > when you create the initial jobs
> > array you zero it via calloc, but
> > after you expand it via realloc/memcpy
> > the expanded area isn't zeroed.
> > Then I remembered the reason for
> > this patch is it's performance
> > critical code, and that if that
> > memory ever got read before
> > being written it's a horrible
> > logic bug anyway :-).
> Yep. Thanks for pushing. The initial calloc is just for the
> array style, it's not to ensure 0ing. True, this was not
> clear, sorry for that. For me the most tricky piece of the
> code was the memcpy after the realloc. Took a while and a
> few arrays drawn on paper until it appeared to me how simple
> this actually is.
Yep. That code was the one that took me the
most time to review also :-).
More information about the samba-technical