2010-01-28 14:04:53

by Andy Adamson

[permalink] [raw]
Subject: [PATCH 1/1] nfs41 do not allocate unused back channel pages

From: Andy Adamson <[email protected]>

Signed-off-by: Andy Adamson <[email protected]>
---
net/sunrpc/svc.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 538ca43..c9991e8 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -506,6 +506,12 @@ svc_init_buffer(struct svc_rqst *rqstp, unsigned int size)
{
unsigned int pages, arghi;

+#if defined(CONFIG_NFS_V4_1)
+ /* bc_xprt uses fore channel allocated buffers */
+ if (rqstp->rq_server->bc_xprt)
+ return 1;
+#endif /* CONFIG_NFS_V4_1 */
+
pages = size / PAGE_SIZE + 1; /* extra page as we hold both request and reply.
* We assume one is at most one page
*/
--
1.6.6



2010-01-28 14:10:01

by Trond Myklebust

[permalink] [raw]
Subject: Re: [PATCH 1/1] nfs41 do not allocate unused back channel pages

On Tue, 2010-01-26 at 20:49 -0500, [email protected] wrote:
> From: Andy Adamson <[email protected]>
>
> Signed-off-by: Andy Adamson <[email protected]>
> ---
> net/sunrpc/svc.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
> index 538ca43..c9991e8 100644
> --- a/net/sunrpc/svc.c
> +++ b/net/sunrpc/svc.c
> @@ -506,6 +506,12 @@ svc_init_buffer(struct svc_rqst *rqstp, unsigned int size)
> {
> unsigned int pages, arghi;
>
> +#if defined(CONFIG_NFS_V4_1)
> + /* bc_xprt uses fore channel allocated buffers */
> + if (rqstp->rq_server->bc_xprt)
> + return 1;
> +#endif /* CONFIG_NFS_V4_1 */
> +
> pages = size / PAGE_SIZE + 1; /* extra page as we hold both request and reply.
> * We assume one is at most one page
> */

Can we replace this with a 'svc_is_backchannel(rqstp->rq_server)' type
of test? That would make it a bit easier on the eyes.