Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ksmbd: increase session and share hash table bits

Increases the number of bits for the hash table from 3 to 12.
The thousands of sessions and shares can be connected.
So the current 3-bit size can lead to frequent hash collisions.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>

authored by

Namjae Jeon and committed by
Steve French
e28c5bc4 0bcc831b

+2 -2
+1 -1
fs/smb/server/mgmt/share_config.c
··· 19 19 #include "../transport_ipc.h" 20 20 #include "../misc.h" 21 21 22 - #define SHARE_HASH_BITS 3 22 + #define SHARE_HASH_BITS 12 23 23 static DEFINE_HASHTABLE(shares_table, SHARE_HASH_BITS); 24 24 static DECLARE_RWSEM(shares_table_lock); 25 25
+1 -1
fs/smb/server/mgmt/user_session.c
··· 18 18 19 19 static DEFINE_IDA(session_ida); 20 20 21 - #define SESSION_HASH_BITS 3 21 + #define SESSION_HASH_BITS 12 22 22 static DEFINE_HASHTABLE(sessions_table, SESSION_HASH_BITS); 23 23 static DECLARE_RWSEM(sessions_table_lock); 24 24