Bug 2143 - cifs client does not support large read
Summary: cifs client does not support large read
Status: RESOLVED LATER
Alias: None
Product: CifsVFS
Classification: Unclassified
Component: kernel fs (show other bugs)
Version: 2.6
Hardware: x86 Linux
: P3 enhancement
Target Milestone: ---
Assignee: Steve French
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-10 08:26 UTC by Dan Singletary
Modified: 2005-03-07 21:16 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Singletary 2004-12-10 08:26:51 UTC
When copying files from a mounted cifs volume to the local filesystem, cifs only
makes SMB requests in 4096-byte blocks, even if the server indicates that it
supports "large read andx".  In fact, these flags don't seem to be checked
anywhere in the cifs code so it looks as if support for this capability simply
hasn't been added yet.  When reading data into the page cache, it appears that
cifs restricts the size of the reads to the "max buffer length" negotiated at
the beginning of the session (aka 'rsize' in the code), however if the server
advertizes "large read andx/large write andx" capability, then I believe the
client is permitted to request up to 64k at a time.  Packet traces of WinXP <->
WinXP SMB sessions reveal that these large packets are used all over the place,
while WinXP <-> linux cifs client does not use them at all.

Taking advantage of the "large read andx" availability is critical to LAN
performance.  Right now I'm only seeing about 3 MB/s transfer rate over a 1Gbps
network, when I should be seeing transfer rates around 20MB/s (speed of the disk
drives involved).
Comment 1 Steve French 2004-12-10 13:46:40 UTC
With the mount option "forcedirectio" current cifs under test will support more 
than 4K writes if the app requests up to max of buffer size 16K if server is 
configured as is usual (cifs can support more than 16K reads and writes only if 
fs/cifs/cifspdu.h MAX_CIFS_MSGSIZE is increased beyond its default of 4 pages 
and servers max xmit is increased in server config)

The pressing need is for a cifs_writepages implementation (for multipage 
write). This has not been written - although multipage cifs_readpages is 
implemented (although not optimal - as you note 128K is preferred)
Comment 2 Steve French 2005-03-07 21:16:17 UTC
this is better now - the code handles the large read flag and can do 127K reads 
if the cifs buf size is increased at insmod time (modinfo cifs.ko to see the 
name of the parm) and if rsize on the mount line is increased and forcedirectio 
specified on mount as well.  I agree that I eventually should be able to handle 
reads bigger than the negotiated buffer size even without mounting 
forcedirectio.