ctdb: Adding memory pool for queue callback

Swen Schillig swen at vnet.ibm.com
Wed Nov 7 15:30:58 UTC 2018


On Wed, 2018-11-07 at 16:09 +0100, Volker Lendecke wrote:
> On Wed, Nov 07, 2018 at 04:07:51PM +0100, Volker Lendecke via samba-
> technical wrote:
> > On Wed, Nov 07, 2018 at 04:01:02PM +0100, Swen Schillig wrote:
> > > In the area where the pool is introduced we almost always have
> > > the
> > > situation that no memory from the pool is used (all mem
> > > available)
> > > and we just want to make use of the fact that we re-use this
> > > memory.
> > 
> > Right, and this is what the talloc speedtest under
> > lib/talloc/testsuite.c:855ff also attempts.
> > 
> > > I just wrote a quick program which is simulating this scenrario
> > > with
> > > the 3 different options with which we could get such memory with
> > > the
> > > following result
> > > 
> > > [swen at linux ~]$ ./a.out
> > > It took 2.219697 seconds to execute 10 million talloc/free
> > > cycles.
> > > It took 1.450206 seconds to execute 10 million talloc(pool)/free
> > > cycles.
> > 
> > There must be a significant difference to the test program in
> > lib/talloc/testsuite.c and yours. Why is your difference closer to
> > a
> > factor of 2 and not 2% like in lib/talloc/testsuite.c, and does
> > that
> > precisely match 
> 
> oops, sentence cut of... "and does that precisely match the ctdb use
> pattern" was what I wanted to say.

Oh, didn't answer your last question....
yes, it does match the CTDB use pattern where we fetch a pool and then
re-use that memory for as long as we use that queue/connection.

Cheers Swen




More information about the samba-technical mailing list