Talloc sonsidered harmful to performance testing ...
Richard Sharpe
realrichardsharpe at gmail.com
Sun Jun 7 12:46:40 MDT 2015
Hi folks,
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
extensions support.
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:
test: loop-createposix-close
time: 2015-06-07 11:00:53.685405
time: 2015-06-07 11:03:41.035283
success: loop-createposix-close
test: loop-create-getinfo-close
time: 2015-06-07 11:03:41.036257
time: 2015-06-07 11:13:42.639715
success: loop-create-getinfo-close
test: loop-openposix-close
time: 2015-06-07 11:13:42.639761
time: 2015-06-07 11:16:17.972404
success: loop-openposix-close
test: loop-open-getinfo-close
time: 2015-06-07 11:16:17.972474
time: 2015-06-07 11:26:35.399646
success: loop-open-getinfo-close
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);
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.
Attached are my patches.
--
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: new-posix-create-with-getinfo-1.patch
Type: text/x-patch
Size: 14433 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150607/b3b33751/attachment.bin>
More information about the samba-technical
mailing list