talloc_pooled_object patchset

Jeremy Allison jra at samba.org
Wed Aug 21 17:35:21 MDT 2013


On Tue, Aug 20, 2013 at 04:25:26PM -0700, Jeremy Allison wrote:
> On Tue, Aug 06, 2013 at 07:47:22AM +0200, Volker Lendecke wrote:
> > Hi!
> > 
> > Attached find a patchset that implements
> > talloc_pooled_object. The idea is basically that
> > tevent_req_create only does one malloc instead of three, and
> > for example cp_smb_filename also does just one:
> > 
> > talloc_pooled_object allocates a basic object as a pool
> > similar to talloc(). Additionally, this object itself is a
> > pool that will host num_members of user-visible size
> > member_size.
> > 
> > A very simple test fetching a 1G file with aio read size = 1
> > with smbclient according to valgrind's callgrind gives a
> > reduction of user-space instructions of roughly 7%. In more
> > complex tests, I think this has also the potential to reduce
> > malloc fragmentation.
> > 
> > This is not yet ready for pushing, with valgrind I still see
> > invalid writes. But I suspect this is due to invalid
> > valgrind instrumentation, this patchset does survive
> > autobuild.
> > 
> > Comments?
> > 
> > Volker
> > 
> > P.S.: To me, this is really complex stuff, so if you have
> > time and want to get your hands dirty, please do a thorough
> > review!
> 
> Ok, I've done a thorough review, and this is +1 from
> me. However, I'm determined to track down the valgrind
> error - I'm pretty sure it's an incorrect use of the
> TC_INVALIDATE_XXX macros inside a talloc_free() when
> a pointer has been talloc_steal() (talloc_stolen :-).
> 
> But I'm going to make sure...

FYI. I'm making progress in the valgrind issue. It's
to do with nested undefined calls when allocating from
inside a pool. Still working intently on this. I really
want to make it valgrind clean.

Jeremy.


More information about the samba-technical mailing list