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

NFSv4.1: Add a module parameter to set the number of session slots

Add the module parameter 'max_session_slots' to set the initial number
of slots that the NFSv4.1 client will attempt to negotiate with the
server.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

+18 -3
+8
Documentation/kernel-parameters.txt
··· 1657 1657 of returning the full 64-bit number. 1658 1658 The default is to return 64-bit inode numbers. 1659 1659 1660 + nfs.max_session_slots= 1661 + [NFSv4.1] Sets the maximum number of session slots 1662 + the client will attempt to negotiate with the server. 1663 + This limits the number of simultaneous RPC requests 1664 + that the client can send to the NFSv4.1 server. 1665 + Note that there is little point in setting this 1666 + value higher than the max_tcp_slot_table_limit. 1667 + 1660 1668 nfs.nfs4_disable_idmapping= 1661 1669 [NFSv4] When set to the default of '1', this option 1662 1670 ensures that both the RPC level authentication
+7 -1
fs/nfs/nfs4proc.c
··· 72 72 73 73 #define NFS4_MAX_LOOP_ON_RECOVER (10) 74 74 75 + static unsigned short max_session_slots = NFS4_DEF_SLOT_TABLE_SIZE; 76 + 75 77 struct nfs4_opendata; 76 78 static int _nfs4_proc_open(struct nfs4_opendata *data); 77 79 static int _nfs4_recover_proc_open(struct nfs4_opendata *data); ··· 5247 5245 args->fc_attrs.max_rqst_sz = mxrqst_sz; 5248 5246 args->fc_attrs.max_resp_sz = mxresp_sz; 5249 5247 args->fc_attrs.max_ops = NFS4_MAX_OPS; 5250 - args->fc_attrs.max_reqs = session->clp->cl_rpcclient->cl_xprt->max_reqs; 5248 + args->fc_attrs.max_reqs = max_session_slots; 5251 5249 5252 5250 dprintk("%s: Fore Channel : max_rqst_sz=%u max_resp_sz=%u " 5253 5251 "max_ops=%u max_reqs=%u\n", ··· 6391 6389 &nfs4_xattr_nfs4_acl_handler, 6392 6390 NULL 6393 6391 }; 6392 + 6393 + module_param(max_session_slots, ushort, 0644); 6394 + MODULE_PARM_DESC(max_session_slots, "Maximum number of outstanding NFSv4.1 " 6395 + "requests the client will negotiate"); 6394 6396 6395 6397 /* 6396 6398 * Local variables:
+3 -2
include/linux/nfs_fs_sb.h
··· 190 190 191 191 192 192 /* maximum number of slots to use */ 193 - #define NFS4_MAX_SLOT_TABLE (128U) 193 + #define NFS4_DEF_SLOT_TABLE_SIZE (16U) 194 + #define NFS4_MAX_SLOT_TABLE (256U) 194 195 #define NFS4_NO_SLOT ((u32)-1) 195 196 196 197 #if defined(CONFIG_NFS_V4) 197 198 198 199 /* Sessions */ 199 - #define SLOT_TABLE_SZ (NFS4_MAX_SLOT_TABLE/(8*sizeof(long))) 200 + #define SLOT_TABLE_SZ DIV_ROUND_UP(NFS4_MAX_SLOT_TABLE, 8*sizeof(long)) 200 201 struct nfs4_slot_table { 201 202 struct nfs4_slot *slots; /* seqid per slot */ 202 203 unsigned long used_slots[SLOT_TABLE_SZ]; /* used/unused bitmap */