[PATCH] optimize aio rw path

Volker Lendecke Volker.Lendecke at SerNet.DE
Thu Mar 27 04:28:58 MDT 2014

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.


SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de

More information about the samba-technical mailing list