aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprt.c
diff options
context:
space:
mode:
authorChuck Lever <cel@netapp.com>2006-01-03 03:55:49 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-01-06 14:58:55 -0500
commit02107148349f31eee7c0fb06fd7a880df73dbd20 (patch)
tree37bffd81e08b8e50394ce89a1aa7a3961f0ffbe7 /net/sunrpc/xprt.c
parent03c21733938aad0758f5f88e1cc7ede69fc3c910 (diff)
SUNRPC: switchable buffer allocation
Add RPC client transport switch support for replacing buffer management on a per-transport basis. In the current IPv4 socket transport implementation, RPC buffers are allocated as needed for each RPC message that is sent. Some transport implementations may choose to use pre-allocated buffers for encoding, sending, receiving, and unmarshalling RPC messages, however. For transports capable of direct data placement, the buffers can be carved out of a pre-registered area of memory rather than from a slab cache. Test-plan: Millions of fsx operations. Performance characterization with "sio" and "iozone". Use oprofile and other tools to look for significant regression in CPU utilization. Signed-off-by: Chuck Lever <cel@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r--net/sunrpc/xprt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 6dda3860351f..069a6cbd49ea 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -838,6 +838,8 @@ static void xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt)
838 req->rq_timeout = xprt->timeout.to_initval; 838 req->rq_timeout = xprt->timeout.to_initval;
839 req->rq_task = task; 839 req->rq_task = task;
840 req->rq_xprt = xprt; 840 req->rq_xprt = xprt;
841 req->rq_buffer = NULL;
842 req->rq_bufsize = 0;
841 req->rq_xid = xprt_alloc_xid(xprt); 843 req->rq_xid = xprt_alloc_xid(xprt);
842 req->rq_release_snd_buf = NULL; 844 req->rq_release_snd_buf = NULL;
843 dprintk("RPC: %4d reserved req %p xid %08x\n", task->tk_pid, 845 dprintk("RPC: %4d reserved req %p xid %08x\n", task->tk_pid,
@@ -867,6 +869,7 @@ void xprt_release(struct rpc_task *task)
867 mod_timer(&xprt->timer, 869 mod_timer(&xprt->timer,
868 xprt->last_used + xprt->idle_timeout); 870 xprt->last_used + xprt->idle_timeout);
869 spin_unlock_bh(&xprt->transport_lock); 871 spin_unlock_bh(&xprt->transport_lock);
872 xprt->ops->buf_free(task);
870 task->tk_rqstp = NULL; 873 task->tk_rqstp = NULL;
871 if (req->rq_release_snd_buf) 874 if (req->rq_release_snd_buf)
872 req->rq_release_snd_buf(req); 875 req->rq_release_snd_buf(req);