Talloc sonsidered harmful to performance testing ...

Matthieu Patou mat at samba.org
Sun Jun 7 13:28:47 MDT 2015

On 06/07/2015 11:46 AM, Richard Sharpe wrote:
> This seems to be because of the following code in smb2_pull_o16s16_blob:
>          *blob = data_blob_talloc(mem_ctx, buf->hdr + ofs, size);
>          NT_STATUS_HAVE_NO_MEMORY(blob->data);
>          return NT_STATUS_OK;
> Does anyone have any comments? If I get a chance I might modify that
> code to use any passed in blob if it is big enough.
Did you try to run perf on it ? if not can you run:
perf -F 99 -g -a -- sleep 600
perf script >smbtorture.perf.out

Adapt 600 so that perf capture the time when you are running your 

Also have you tried to use a talloc_pool, with talloc pool you can 
allocate a big memory chunk and let talloc tap into it.
It should be much faster.

Also you should check if you are not spending too much time feeing 
talloc stuff, even with a talloc pool it takes still a lot of time 
sometimes because you have a lot of objects and talloc has to go through 
all of them (I wish we had a way to say free the whole talloc pool at 
once, don't recurse).

Matthieu Patou
Samba Team

More information about the samba-technical mailing list