aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-02-06 19:50:40 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-02-15 00:19:44 -0500
commitef159e9177cc5a09e6174796dde0b2d243ddf28b (patch)
tree848dc5cc90b9090a1bfb00021cf3e3511569fdef
parent45d43c291e9a922d7b432b0dbcb1d8fb70d8410f (diff)
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>
-rw-r--r--Documentation/kernel-parameters.txt8
-rw-r--r--fs/nfs/nfs4proc.c8
-rw-r--r--include/linux/nfs_fs_sb.h5
3 files changed, 18 insertions, 3 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 033d4e69b43b..1d369c6286e1 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1657,6 +1657,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
1657 of returning the full 64-bit number. 1657 of returning the full 64-bit number.
1658 The default is to return 64-bit inode numbers. 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 nfs.nfs4_disable_idmapping= 1668 nfs.nfs4_disable_idmapping=
1661 [NFSv4] When set to the default of '1', this option 1669 [NFSv4] When set to the default of '1', this option
1662 ensures that both the RPC level authentication 1670 ensures that both the RPC level authentication
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index f3f56f4a3b72..0b3316541734 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -72,6 +72,8 @@
72 72
73#define NFS4_MAX_LOOP_ON_RECOVER (10) 73#define NFS4_MAX_LOOP_ON_RECOVER (10)
74 74
75static unsigned short max_session_slots = NFS4_DEF_SLOT_TABLE_SIZE;
76
75struct nfs4_opendata; 77struct nfs4_opendata;
76static int _nfs4_proc_open(struct nfs4_opendata *data); 78static int _nfs4_proc_open(struct nfs4_opendata *data);
77static int _nfs4_recover_proc_open(struct nfs4_opendata *data); 79static int _nfs4_recover_proc_open(struct nfs4_opendata *data);
@@ -5245,7 +5247,7 @@ static void nfs4_init_channel_attrs(struct nfs41_create_session_args *args)
5245 args->fc_attrs.max_rqst_sz = mxrqst_sz; 5247 args->fc_attrs.max_rqst_sz = mxrqst_sz;
5246 args->fc_attrs.max_resp_sz = mxresp_sz; 5248 args->fc_attrs.max_resp_sz = mxresp_sz;
5247 args->fc_attrs.max_ops = NFS4_MAX_OPS; 5249 args->fc_attrs.max_ops = NFS4_MAX_OPS;
5248 args->fc_attrs.max_reqs = session->clp->cl_rpcclient->cl_xprt->max_reqs; 5250 args->fc_attrs.max_reqs = max_session_slots;
5249 5251
5250 dprintk("%s: Fore Channel : max_rqst_sz=%u max_resp_sz=%u " 5252 dprintk("%s: Fore Channel : max_rqst_sz=%u max_resp_sz=%u "
5251 "max_ops=%u max_reqs=%u\n", 5253 "max_ops=%u max_reqs=%u\n",
@@ -6390,6 +6392,10 @@ const struct xattr_handler *nfs4_xattr_handlers[] = {
6390 NULL 6392 NULL
6391}; 6393};
6392 6394
6395module_param(max_session_slots, ushort, 0644);
6396MODULE_PARM_DESC(max_session_slots, "Maximum number of outstanding NFSv4.1 "
6397 "requests the client will negotiate");
6398
6393/* 6399/*
6394 * Local variables: 6400 * Local variables:
6395 * c-basic-offset: 8 6401 * c-basic-offset: 8
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 2ae57f2f645b..3bf47666646e 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -190,13 +190,14 @@ struct nfs_server {
190 190
191 191
192/* maximum number of slots to use */ 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#define NFS4_NO_SLOT ((u32)-1) 195#define NFS4_NO_SLOT ((u32)-1)
195 196
196#if defined(CONFIG_NFS_V4) 197#if defined(CONFIG_NFS_V4)
197 198
198/* Sessions */ 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))
200struct nfs4_slot_table { 201struct nfs4_slot_table {
201 struct nfs4_slot *slots; /* seqid per slot */ 202 struct nfs4_slot *slots; /* seqid per slot */
202 unsigned long used_slots[SLOT_TABLE_SZ]; /* used/unused bitmap */ 203 unsigned long used_slots[SLOT_TABLE_SZ]; /* used/unused bitmap */