summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2003-06-23 22:15:43 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-06-23 22:15:43 -0700
commit6571a99982e78d29c75bc00088302ccf37c91185 (patch)
tree2b784408da7bebc25f71a845a1394d0c009b1aa3 /include
parent4f819f27863582154ae8a736dcf2e7f1636a6148 (diff)
[PATCH] Get buf size and page count right for RPC services.
The old calculations BUGed on 64k PAGESIZE machines.
Diffstat (limited to 'include')
-rw-r--r--include/linux/sunrpc/svc.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 20773282fada..71cd5d8daf23 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -57,11 +57,11 @@ struct svc_serv {
* Requests are copied into these pages as they arrive. Remaining
* pages are available to write the reply into.
*
- * Currently pages are all re-used by the same server. Later we
- * will use ->sendpage to transmit pages with reduced copying. In
- * that case we will need to give away the page and allocate new ones.
- * In preparation for this, we explicitly move pages off the recv
- * list onto the transmit list, and back.
+ * Pages are sent using ->sendpage so each server thread needs to
+ * allocate more to replace those used in sending. To help keep track
+ * of these pages we have a receive list where all pages initialy live,
+ * and a send list where pages are moved to when there are to be part
+ * of a reply.
*
* We use xdr_buf for holding responses as it fits well with NFS
* read responses (that have a header, and some data pages, and possibly
@@ -72,8 +72,11 @@ struct svc_serv {
* list. xdr_buf.tail points to the end of the first page.
* This assumes that the non-page part of an rpc reply will fit
* in a page - NFSd ensures this. lockd also has no trouble.
+ *
+ * Each request/reply pair can have at most one "payload", plus two pages,
+ * one for the request, and one for the reply.
*/
-#define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 1)
+#define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2)
static inline u32 svc_getu32(struct iovec *iov)
{