Talloc sonsidered harmful to performance testing ...
realrichardsharpe at gmail.com
Sun Jun 7 12:46:40 MDT 2015
I have been working with Steve French to implement some POSIX
extenstions for SMB2/3.
I have written code that uses CREATE CONTEXTS to signal that we want
case-sensitive file names and that we want POSIX info returned in an
open response, but I have also extended GET INFO to accept an
SMB2_GETINFO_UNIX type and mapped that onto the standard Samba CIFS
Then I wrote a torture test to compare the performance of:
1. 100,000 CREATE-with-POSIX-semantics plus return POSIX stat and then
close (including delete on close)
2. 100,000 CREATE-with-POSIX-semantics, then GETINFO UNIX_BASIC and
then close (including delete on close)
3. 100,000 CREATE-with-POSIX-semantics of existing file plus return
POSIX stat and then close (and no delete on close)
4. 100,000 CREATE-with-POSIX-semantics, then GETINFO UNIX_BASIC and
then close (and no delete on close)
Here are the results against localhost:
time: 2015-06-07 11:00:53.685405
time: 2015-06-07 11:03:41.035283
time: 2015-06-07 11:03:41.036257
time: 2015-06-07 11:13:42.639715
time: 2015-06-07 11:13:42.639761
time: 2015-06-07 11:16:17.972404
time: 2015-06-07 11:16:17.972474
time: 2015-06-07 11:26:35.399646
As you can see, the runs doing GET INFO take seven minutes longer than
the runs without. When it was running smbtorture was getting 90+% of
the CPU (one CPU) and smbd was getting very small amounts of CPU and
was not growing in size at all.
This seems to be because of the following code in smb2_pull_o16s16_blob:
*blob = data_blob_talloc(mem_ctx, buf->hdr + ofs, size);
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.
Attached are my patches.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 14433 bytes
Desc: not available
More information about the samba-technical