Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: nspmangalore@gmail.com
To: linux-cifs@vger.kernel.org, smfrench@gmail.com, pc@manguebit.com,
	bharathsm@microsoft.com
Cc: Shyam Prasad N <sprasad@microsoft.com>
Subject: [PATCH 5/5] cifs: enforce nosharesock when multichannel is used
Date: Thu,  1 Feb 2024 11:15:30 +0000	[thread overview]
Message-ID: <20240201111530.17194-5-sprasad@microsoft.com> (raw)
In-Reply-To: <20240201111530.17194-1-sprasad@microsoft.com>

From: Shyam Prasad N <sprasad@microsoft.com>

In the current architecture, multiple sessions can
share the primary channel, but secondary channels for
each session is not shared.

This can create two problems when primary channel is
shared among several sessions. For one, there could be
uneven utilization of channels due to this skew.

Another major issue is how a cifsd thread can get to
the channel for a secondary channel. The process is
already cumbersome. We also need to find the right
session for the server struct.

To avoid both the problems, this change marks even the
primary channel as nosharesock. Secondary channels are
marked as nosharesock anyway.

We can remove this when we fix the mchan architecture
to share all channels.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
---
 fs/smb/client/fs_context.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c
index 82eafe0815dc..e7543574ea9e 100644
--- a/fs/smb/client/fs_context.c
+++ b/fs/smb/client/fs_context.c
@@ -1043,6 +1043,8 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
 			ctx->max_channels = 1;
 		} else {
 			ctx->multichannel = true;
+			/* enforce nosharesock */
+			ctx->nosharesock = true;
 			/* if number of channels not specified, default to 2 */
 			if (ctx->max_channels < 2)
 				ctx->max_channels = 2;
-- 
2.34.1


  parent reply	other threads:[~2024-02-01 11:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01 11:15 [PATCH 1/5] cifs: avoid redundant calls to disable multichannel nspmangalore
2024-02-01 11:15 ` [PATCH 2/5] cifs: change tcon status when need_reconnect is set on it nspmangalore
2024-02-01 11:15 ` [PATCH 3/5] cifs: do not search for channel if server is terminating nspmangalore
2024-02-01 11:15 ` [PATCH 4/5] cifs: failure to add channel on iface should bump up weight nspmangalore
2024-02-01 11:15 ` nspmangalore [this message]
2024-02-06  6:13   ` [PATCH 5/5] cifs: enforce nosharesock when multichannel is used Shyam Prasad N

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240201111530.17194-5-sprasad@microsoft.com \
    --to=nspmangalore@gmail.com \
    --cc=bharathsm@microsoft.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=pc@manguebit.com \
    --cc=smfrench@gmail.com \
    --cc=sprasad@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox