smb3: improve parallel reads of large files
authorSteve French <stfrench@microsoft.com>
Mon, 8 May 2023 05:45:45 +0000 (00:45 -0500)
committerSteve French <stfrench@microsoft.com>
Thu, 1 Jun 2023 04:49:23 +0000 (23:49 -0500)
rasize (ra_pages) should be set higher than read size by default
to allow parallel reads when reading large files in order to
improve performance (otherwise there is much dead time on the
network when doing readahead of large files).  Default rasize
to twice readsize.

Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifsfs.c

index 023954cf202925d0d8d5799a943ef403b92faf85..88d40ecab2bf58169d73cbbd7f1c2807a7576a61 100644 (file)
@@ -245,7 +245,7 @@ cifs_read_super(struct super_block *sb)
        if (cifs_sb->ctx->rasize)
                sb->s_bdi->ra_pages = cifs_sb->ctx->rasize / PAGE_SIZE;
        else
-               sb->s_bdi->ra_pages = cifs_sb->ctx->rsize / PAGE_SIZE;
+               sb->s_bdi->ra_pages = 2 * (cifs_sb->ctx->rsize / PAGE_SIZE);
 
        sb->s_blocksize = CIFS_MAX_MSGSIZE;
        sb->s_blocksize_bits = 14;      /* default 2**14 = CIFS_MAX_MSGSIZE */