linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cifs large write performance improvements to Samba
@ 2004-12-13  5:45 Steve French
  2004-12-13 14:38 ` bert hubert
  0 siblings, 1 reply; 10+ messages in thread
From: Steve French @ 2004-12-13  5:45 UTC (permalink / raw)
  To: linux-kernel, linux-cifs-client, samba-technical

Some informal results evaluating the results of new cifs directio mount
option and effects of changing the SMB network buffer size.  All tests
were run at least four times on each configuration and averaged.

Command executed: time dd if=/dev/zero of=/mnt/ofile bs=1M count=400 
(400MB copy to server with large writes)

MemTotal on system: 905148kB (from /proc/meminfo)

Kernel: current 2.6.10-rc3 from linux.bkbits.net/linux-2.5 bk
SLES9 JFS (and EXT3 on one test). Intel Pentium M, relatively slower IDE
drives (laptop). Kernel compiled for debug memory allocations.

CIFS filesystem version: 1.28

Samba version 3.0.10pre (current svn)

mount over loopback interface to samba server on the same box (to
maximize network transfer speed)


CIFS mount (default): 1 minute 46 seconds (constrained largely by the 4K
writes, due to no implementation of page coalescing and no
implementation of cifs_writepages)

CIFS mount (directio): 35.9 seconds (huge improvement due to now being
able to do up to 16K size writes to server, and reducing double caching
effects since page cache not used on client side). Running with a faster
processor (otherwise the same) this dropped to 20.8 second average.

CIFS mount (directio, insmod specifying larger CIFSMaxBufSize of 65024):
24.0 seconds  The larger buffer size (almost 4 times larger) led to
significant improvements (going beyond this to 120K network write size
did not improve performance on this test, actually got a bit worse).
Running with a faster processor (otherwise the same) this improved to
19.3 seconds average (and using the even larger 120K write size
performance dropped slightly to 20.6 seconds)

Additional comparison points - 
The older smbfs filesystem: 1 minute 7.04 seconds (note that smbfs read
performance is much worse than cifs in part due to lack of readpages
implementation in smbfs, but the writepage performances differ less
significantly)

Local performance: 
JFS  3.5 seconds
EXT3 12.8 seconds

EXT3 was somewhat slower than I expected.  

The does show that cifs directio mounts help a lot for large file copy -
and also that cifs badly needs an asyn writepages implementation (which
has obviously helped NFS on this kind of test). In addition CIFS needs
to reduce some of the CPU (one of the large buf allocs and memcpys in
the write path can be eliminated with some reasonably obvious changes). 
I doubt that enough analysis on the Samba server side has been done for
this particular case on 2.6 and that might yield some easy improvements
as well.  Also note that there was one case in which cifs to Samba ran
into the expected memory contention deadlock (client writes dirty page
to server, server blocked on memory allocation which is blocked on
client's write).



^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: cifs large write performance improvements to Samba
@ 2004-12-13 16:56 Steve French
  2004-12-13 17:20 ` cliff white
  0 siblings, 1 reply; 10+ messages in thread
From: Steve French @ 2004-12-13 16:56 UTC (permalink / raw)
  To: linux-kernel

The current mainline (very recent 2.6.10-rc Linux tree) should be fine 
from memory leak perspective.  No such leaks have been reported AFAIK on 
current cifs code and certainly none that I have detected in heavy 
stress testing. 

I do need to add some additional filesystem tests to the regression test 
mix soon, and I have asked one  of the guys here  with a ppc64 box to 
run some more bigendian tests on it too.   The ltp has filesystems tests 
scatterred in multiple directories which I need to track down and setup 
scripts to automate (e.g. the sendfile tests are not in the same 
directory with other tests in testcases/kernel/fs, nor is the very 
useful "connectathon nfs" posix filesystem test suite)

The oops (referenced in your post) does need to be fixed of course, but 
since the code that would cause it is disabled (and only is broken to 
certain servers and is noted as broken in the TODO list, implying that 
it should not be turned on in /proc/fs/cifs) - I was considering it 
lower priority than the other issues recently fixed which have been 
consuming my time.  Fixing/adding support for extended security is 
getting closer to the top of the priority list now though.  If I can at 
least prevent the oops with a small change (even if it does not fully 
fix the spnego code) I will push that changeset in soon.   The userspace 
piece should be -- much -- easier to communicate with now that the 
kevents stuff is in.    Very high on the list as well is getting NTLMv2 
tested and working as many environments require it.  Figuring out the 
mysterious byte range lock failure which sometimes occurs on an unlock 
in locktest 7 (I noticed it starting after the nfs changes for the vfs 
posix locking a few months ago) and I have posted about before (Kernel 
panic - not syncing: Attempting to free lock with active blocklist) is a 
slightly higher priority.  Basically I need to figure out what is going 
on with the line in fs/locks.c?

       if (!list_empty <http://lxr.linux.no/ident?v=2.6.8.1;i=list_empty>(&fl->fl_block)
		 panic <http://lxr.linux.no/ident?v=2.6.8.1;i=panic>(/"Attempting to free lock with active block list"/);


Since I am not adding anything to the fl_block list intentionally, I 
need to find out what causes items to be added to the fl_block list (ie 
when the locks_insert_block and locks_delete_block call are made and why 
they sometimes happen differently in lock test 7 then in other byte 
range lock testcases in which unlock obviously works fine).

On the issue of regressing back to smbfs :)  There are a few things 
which can be done that would help.

1) Need to post an updated version of when to still use smbfs for an 
occassional mount (there are only a couple of cases in which smbfs has 
to be used now but they are important to some users - such as users who 
have to access an occassional old OS/2 or DOS server, or who need 
Kerberos), and I need to add it that chart to the fs/cifs/README and the 
project page etc.
2) Public view of the status of testing - the raw data needs to be 
posted regularly as kernel updated (and against five or six different 
server types) so users see what is broken in smbfs (and so users can see 
what posix issues are still being worked on cifs and any known 
problems).   smbfs fails about half of the filesystem tests that I have 
tried, due to stress issues, or because the tests requires better posix 
compliance or because of various smbfs stability fixes.

  If only someone could roll all of the key fs tests into a set of 
scripts which could generate one regularly updated set of test status 
chart ... one for each of XFS, JFS, ext3, Reiser3, CIFS (against various 
servers, Samba version etc), NFSv2, NFSv3, NFSv4 (against various 
servers), AFS but that would be a lot of work (not to run) but the first 
time writing/setup of the scripts to launch the tests in the right order 
since some failures may be expected (at least for the network 
filesystems) due to hard to implement features (missing fcntls, dnotify, 
get/setlease, differences in byte range lock semantics, lack of flock 
etc.) and also since the most sensible NFS, AFS and CIFS tests would 
involve more than one client (to test caching/oplock/token management 
semantics better) but no such fs tests AFAIK exist for Linux.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-12-22 14:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-13  5:45 cifs large write performance improvements to Samba Steve French
2004-12-13 14:38 ` bert hubert
     [not found]   ` <41BDC911.9010600@austin.rr.com>
2004-12-22 14:56     ` bert hubert
2004-12-13 16:56 Steve French
2004-12-13 17:20 ` cliff white
2004-12-13 18:34   ` Steve French
2004-12-13 18:43     ` Steve French
2004-12-16 12:11       ` Marcelo Tosatti
2004-12-16 18:58         ` Hans Reiser
2004-12-16 16:30           ` Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).