s3:smb2_server: for performance reasons we use tevent_fd and readv/writev directly
commit1b3cf43e423afedf33f8db3b4cd8cf26cda6e019
authorStefan Metzmacher <metze@samba.org>
Mon, 14 Oct 2013 08:33:57 +0000 (14 10:33 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 10 Dec 2013 11:57:29 +0000 (10 12:57 +0100)
treedfa2096355cf9c8e82c426f3b5f31bb369419d8c
parentdc552665b8e41594c4832fe39feda39204d9129c
s3:smb2_server: for performance reasons we use tevent_fd and readv/writev directly

Going via tevent_req_create/talloc_free at multiple layer costs
too much cpu cycles per request.

I tested downloading a 16GB (sparse) file with smbclient -b1 -mNT1,
and -mSMB2_02. Using smb2 max read = 64512, which means smb1 and smb2
will use the same read size.

I build with -O3 -g and compared the results with valgrind --tool=callgrind.

With -mNT1 the server uses about 2.000.000.000 cpu cycles.

This patch reduces the userspace cpu cycles for -mSMB2_02
from about ~ 8.000.000.000 down to ~ 4.000.000.000.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
(cherry picked from commit 4244a2686cddcdc754c284df884ae497afa4053a)
source3/smbd/globals.h
source3/smbd/smb2_server.c