]> git.ipfire.org Git - thirdparty/linux.git/commit - fs/cifs/cifsglob.h
smb3: make default i/o size for smb3 mounts larger
authorSteve French <stfrench@microsoft.com>
Fri, 1 Mar 2019 03:32:15 +0000 (21:32 -0600)
committerSteve French <stfrench@microsoft.com>
Tue, 5 Mar 2019 02:05:35 +0000 (20:05 -0600)
commite8506d25f740fd058791cc12a6dfa9386ada6b96
treead1a9042ca3ded218d907a8b67866a771e39c3f0
parent7b9b9edb49ad377b1e06abf14354c227e9ac4b06
smb3: make default i/o size for smb3 mounts larger

We negotiate rsize mounts (and it can be overridden by user) to
typically 4MB, so using larger default I/O sizes from userspace
(changing to 1MB default i/o size returned by stat) the
performance is much better (and not just for long latency
network connections) in most use cases for SMB3 than the default I/O
size (which ends up being 128K for cp and can be even smaller for cp).
This can be 4x slower or worse depending on network latency.

By changing inode->blocksize from 32K (which was perhaps ok
for very old SMB1/CIFS) to a larger value, 1MB (but still less than
max size negotiated with the server which is 4MB, in order to minimize
risk) it significantly increases performance for the
noncached case, and slightly increases it for the cached case.
This can be changed by the user on mount (specifying bsize=
values from 16K to 16MB) to tune better for performance
for applications that depend on blocksize.

Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
CC: Stable <stable@vger.kernel.org>
fs/cifs/cifs_fs_sb.h
fs/cifs/cifsfs.c
fs/cifs/cifsglob.h
fs/cifs/connect.c
fs/cifs/inode.c