]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cifs: pick channels for individual subrequests
authorShyam Prasad N <sprasad@microsoft.com>
Tue, 11 Feb 2025 10:00:25 +0000 (10:00 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 13:01:37 +0000 (14:01 +0100)
commitc45aa877256a4ec8f9a93a441d7041087cc0f8cf
tree8cd7dc66e9f5d0d8583be9e0b20570f0e359636b
parentfe2a10a4cb19fc9649ab9e47db7a51ad4eec8f7d
cifs: pick channels for individual subrequests

commit f1bf10d7e909fe898a112f5cae1e97ce34d6484d upstream.

The netfs library could break down a read request into
multiple subrequests. When multichannel is used, there is
potential to improve performance when each of these
subrequests pick a different channel.

Today we call cifs_pick_channel when the main read request
is initialized in cifs_init_request. This change moves this to
cifs_prepare_read, which is the right place to pick channel since
it gets called for each subrequest.

Interestingly cifs_prepare_write already does channel selection
for individual subreq, but looks like it was missed for read.
This is especially important when multichannel is used with
increased rasize.

In my test setup, with rasize set to 8MB, a sequential read
of large file was taking 11.5s without this change. With the
change, it completed in 9s. The difference is even more signigicant
with bigger rasize.

Cc: <stable@vger.kernel.org>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/client/cifsglob.h
fs/smb/client/file.c