nfs: increase number of permitted callback connections.
authorNeilBrown <neilb@suse.de>
Tue, 31 Jul 2012 04:40:12 +0000 (14:40 +1000)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 31 Jul 2012 16:33:29 +0000 (12:33 -0400)
By default a sunrpc service is limited to (N+3)*20 connections
where N is the number of threads.  This is 80 when N==1.
If this number is exceeded a warning is printed suggesting that
the number of threads be increased.  However with services which
run a single thread, this is impossible.

For such services there is a ->sv_maxconn setting that can be
used to forcibly increase the limit, and silence the message.
This is used by lockd.

The nfs client uses a sunrpc service to handle callbacks and
it too is single-threaded, so to avoid the useless messages,
and to allow a reasonable number of concurrent connections,
we need to set ->sv_maxconn.  1024 seems like a good number.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/callback.c

index ca3ac992028be0b1a81bb8a00ce8e5d5c353f594..4c8459e5bdeef904e930cff50def65f7ac91f672 100644 (file)
@@ -241,6 +241,10 @@ int nfs_callback_up(u32 minorversion, struct rpc_xprt *xprt)
                ret = -ENOMEM;
                goto out_err;
        }
+       /* As there is only one thread we need to over-ride the
+        * default maximum of 80 connections
+        */
+       serv->sv_maxconn = 1024;
 
        ret = svc_bind(serv, net);
        if (ret < 0) {