ctdb: Adding memory pool for queue callback

Volker Lendecke Volker.Lendecke at SerNet.DE
Wed Nov 7 17:19:29 UTC 2018

On Wed, Nov 07, 2018 at 05:47:02PM +0100, Volker Lendecke via samba-technical wrote:
> On Wed, Nov 07, 2018 at 05:28:04PM +0100, Swen Schillig wrote:
> > showing values like 
> > [swen at linux ~]$ ./a.out 
> > It took 8.963634 seconds to execute 10 million talloc/free cycles.
> > It took 5.951885 seconds to execute 10 million talloc(pool)/free cycles.
> > It took 4.095244 seconds to execute 10 million malloc/free cycles.
> > 
> > So, I think there's still enough progress to justify the change.
> This is with -O3, right? With -O0 the picture looks entirely different
> to me. Are you 100% certain your production build uses -O3?

Just got external confirmation that you are in fact using -O2, which
yields a performance improvement for the talloc_pool solution.

The patch has one bug: The pool is declared as a char*. This must be a
TALLOC_CTX, which is a void*. Minor one, but required IMO.

So based on that micro-benchmark I trust you that you can measure a
performance improvements in SMB-level benchmarks, otherwise it would
not be so imporant for you to get this patch in. The patch has the
downside that it chews a permanent 1k block of memory per ctdb client
connection, and there can be a *LOT* of those.

I know he is difficult to catch these days, but as I am not a core
ctdb developer, I would love Amitay to give a quick comment.

Amitay, this does look sane and reasonably isolated and probably Swen
can prove real-world improvements for his customers. So this gets an
Acked-by: from me (assuming you fix the char*->TALLOC_CTX thingy). For
a full Reviewed-by I think we need Amitay.

With best regards,


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