talloc_pooled_object patchset

Jeremy Allison jra at samba.org
Tue Aug 20 17:25:26 MDT 2013


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...

Jeremy.


More information about the samba-technical mailing list