summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@fys.uio.no>2004-03-13 11:59:23 -0500
committerTrond Myklebust <trond.myklebust@fys.uio.no>2004-03-13 11:59:23 -0500
commitb9315c75b9cd1c20f1390f2054c180be2507dbcc (patch)
tree25bad1757442bd9aac6573edf7dc62d333bc58af /include/linux
parent9c9ff1bc60ce57894c216529adc9505a00b8abb1 (diff)
RPC: patch by Chuck Lever to make the number of RPC slots a tunable parameter.
This is wanted in order to allow the NFS client to send more requests before is has to block and wait for replies. This is mainly useful if you have a WAN and want to ensure that the bandwidth is being used efficiently.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sunrpc/debug.h2
-rw-r--r--include/linux/sunrpc/xprt.h24
2 files changed, 15 insertions, 11 deletions
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index aee7a98a9136..eadb31e3c198 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -92,6 +92,8 @@ enum {
CTL_NFSDEBUG,
CTL_NFSDDEBUG,
CTL_NLMDEBUG,
+ CTL_SLOTTABLE_UDP,
+ CTL_SLOTTABLE_TCP,
};
#endif /* _LINUX_SUNRPC_DEBUG_H_ */
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 1ffa8a74d279..e6d79afcb50c 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -28,16 +28,18 @@
*
* Upper procedures may check whether a request would block waiting for
* a free RPC slot by using the RPC_CONGESTED() macro.
- *
- * Note: on machines with low memory we should probably use a smaller
- * MAXREQS value: At 32 outstanding reqs with 8 megs of RAM, fragment
- * reassembly will frequently run out of memory.
*/
-#define RPC_MAXCONG (16)
-#define RPC_MAXREQS RPC_MAXCONG
-#define RPC_CWNDSCALE (256)
-#define RPC_MAXCWND (RPC_MAXCONG * RPC_CWNDSCALE)
+extern unsigned int xprt_udp_slot_table_entries;
+extern unsigned int xprt_tcp_slot_table_entries;
+
+#define RPC_MIN_SLOT_TABLE (2U)
+#define RPC_DEF_SLOT_TABLE (16U)
+#define RPC_MAX_SLOT_TABLE (128U)
+
+#define RPC_CWNDSHIFT (8U)
+#define RPC_CWNDSCALE (1U << RPC_CWNDSHIFT)
#define RPC_INITCWND RPC_CWNDSCALE
+#define RPC_MAXCWND(xprt) ((xprt)->max_reqs << RPC_CWNDSHIFT)
#define RPCXPRT_CONGESTED(xprt) ((xprt)->cong >= (xprt)->cwnd)
/* Default timeout values */
@@ -92,7 +94,6 @@ struct rpc_rqst {
*/
struct rpc_task * rq_task; /* RPC task data */
__u32 rq_xid; /* request XID */
- struct rpc_rqst * rq_next; /* free list */
int rq_cong; /* has incremented xprt->cong */
int rq_received; /* receive completed */
u32 rq_seqno; /* gss seq no. used on req. */
@@ -145,8 +146,9 @@ struct rpc_xprt {
struct rpc_wait_queue resend; /* requests waiting to resend */
struct rpc_wait_queue pending; /* requests in flight */
struct rpc_wait_queue backlog; /* waiting for slot */
- struct rpc_rqst * free; /* free slots */
- struct rpc_rqst slot[RPC_MAXREQS];
+ struct list_head free; /* free slots */
+ struct rpc_rqst * slot; /* slot table storage */
+ unsigned int max_reqs; /* total slots */
unsigned long sockstate; /* Socket state */
unsigned char shutdown : 1, /* being shut down */
nocong : 1, /* no congestion control */