3783 Flow control is needed in rpcmod when the NFS server is unable to keep up with the network

Review Request #49 — Created May 7, 2015 and submitted


webrev: http://cr.illumos.org/~webrev/marcel/il-3783-rpcmod-flowcontrol/

In case the NFS clients are fast enough and they are able to send more requests than the NFS server is able to handle (for various reasons) the number of queued requests in rpcmod could grow and grow without any limit until the NFS server's memory is exhausted.

This fix implements two conditions to constrain the queued requests. The first condition is based on number of requests queued. The second condition is based on total size occupied by queued requests. For more details about the conditions please read the comment for the svc_flowcontrol() function in the diffs.

Since this fix is in generic rpcmod layer, it applies to other rpcmod pools (like nlm and nfscbd) too.

The flow control is not implemented for RDMA transport, so the RDMA transports will behave unchanged. For TCP, once the flow control turns on, the TCP window will close and the NFS client won't be able to send more requests. For UDP, incoming requests are just discarded once the flow control is activated.

New tunable svc_flowcontrol_disable is implemented too. Once it is set to non-zero it should disable this new flow control functionality.

The fix contains some code and comments cleanup in the rpcmod module.

This fix was thoroughly tested about two years ago in a lab and also by several
customers who were suffered by it.

This fix is included in the NexentaStor since version, so the fix is
permanently tested by all NexentaStor NFS users for very long time now.  No
issues/regressions were reported with this fix.
Review request changed

Status: Closed (submitted)

Change Summary:

commit 2695d4f4d1e2a6022c8a279d40c3cb750964974d
Author:     Marcel Telka <marcel.telka@nexenta.com>
AuthorDate: Tue May 12 21:57:13 2015 +0200
Commit:     Albert Lee <trisk@omniti.com>
CommitDate: Tue May 12 17:23:46 2015 -0400

    3783 Flow control is needed in rpcmod when the NFS server is unable to keep 
    Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
    Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
    Reviewed by: Dan McDonald <danmcd@omniti.com>
    Approved by: Albert Lee <trisk@omniti.com>

:100644 100644 a2ded72... 07719f7... M  usr/src/uts/common/rpc/rpcib.c
:100644 100644 fc99ca8... 09863c9... M  usr/src/uts/common/rpc/rpcmod.c
:100644 100644 250b598... c0ca1ed... M  usr/src/uts/common/rpc/svc.c
:100644 100644 dd3cb44... 134b690... M  usr/src/uts/common/rpc/svc.h
:100644 100644 fafbff2... 87ea2a7... M  usr/src/uts/common/rpc/svc_gen.c
:100644 100644 905b479... e0a0fe3... M  usr/src/uts/common/rpc/svc_rdma.c