summaryrefslogtreecommitdiff
path: root/fs/cifs/misc.c
diff options
context:
space:
mode:
authorShyam Prasad N <sprasad@microsoft.com>2022-07-27 14:49:56 -0500
committerSteve French <stfrench@microsoft.com>2022-08-01 01:34:45 -0500
commitd7d7a66aacd6fd8ca57baf08a7bac5421282f6f8 (patch)
tree2565cb830065b2c06cefd085866c3de926d688b5 /fs/cifs/misc.c
parent1bfa25ee30dfebe32a3b40c1a954052becbd7b8d (diff)
downloadlwn-d7d7a66aacd6fd8ca57baf08a7bac5421282f6f8.tar.gz
lwn-d7d7a66aacd6fd8ca57baf08a7bac5421282f6f8.zip
cifs: avoid use of global locks for high contention data
During analysis of multichannel perf, it was seen that the global locks cifs_tcp_ses_lock and GlobalMid_Lock, which were shared between various data structures were causing a lot of contention points. With this change, we're breaking down the use of these locks by introducing new locks at more granular levels. i.e. server->srv_lock, ses->ses_lock and tcon->tc_lock to protect the unprotected fields of server, session and tcon structs; and server->mid_lock to protect mid related lists and entries at server level. Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/misc.c')
-rw-r--r--fs/cifs/misc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index a825cc09a53e..7a906067db04 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -69,6 +69,7 @@ sesInfoAlloc(void)
ret_buf = kzalloc(sizeof(struct cifs_ses), GFP_KERNEL);
if (ret_buf) {
atomic_inc(&sesInfoAllocCount);
+ spin_lock_init(&ret_buf->ses_lock);
ret_buf->ses_status = SES_NEW;
++ret_buf->ses_count;
INIT_LIST_HEAD(&ret_buf->smb_ses_list);
@@ -126,6 +127,7 @@ tconInfoAlloc(void)
atomic_inc(&tconInfoAllocCount);
ret_buf->status = TID_NEW;
++ret_buf->tc_count;
+ spin_lock_init(&ret_buf->tc_lock);
INIT_LIST_HEAD(&ret_buf->openFileList);
INIT_LIST_HEAD(&ret_buf->tcon_list);
spin_lock_init(&ret_buf->open_file_lock);