Linux NFS development
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: nfs@lists.sourceforge.net, trond.myklebust@fys.uio.no
Subject: Re: [PATCH 13/15] SUNRPC: RPC buffer size estimates are too large
Date: Wed, 24 Jan 2007 15:41:38 -0500	[thread overview]
Message-ID: <45B7C482.9090807@oracle.com> (raw)
In-Reply-To: <20070124203739.GA6587@fieldses.org>

[-- Attachment #1: Type: text/plain, Size: 1950 bytes --]

J. Bruce Fields wrote:
> On Wed, Jan 24, 2007 at 02:20:20PM -0500, Chuck Lever wrote:
>> @@ -753,25 +751,39 @@ call_reserveresult(struct rpc_task *task
>>  static void
>>  call_allocate(struct rpc_task *task)
>>  {
>> +	unsigned int slack = task->tk_auth->au_cslack;
>>  	struct rpc_rqst *req = task->tk_rqstp;
>>  	struct rpc_xprt *xprt = task->tk_xprt;
>> -	unsigned int	bufsiz;
>> +	struct rpc_procinfo *proc = task->tk_msg.rpc_proc;
>>  
>>  	dprint_status(task);
>>  
>> +	task->tk_status = 0;
>>  	task->tk_action = call_bind;
>> +
>>  	if (req->rq_buffer)
>>  		return;
>>  
>> -	/* FIXME: compute buffer requirements more exactly using
>> -	 * auth->au_wslack */
>> -	bufsiz = task->tk_msg.rpc_proc->p_bufsiz + RPC_SLACK_SPACE;
>> +	if (proc->p_proc != 0) {
>> +		BUG_ON(proc->p_arglen == 0);
>> +		if (proc->p_decode != NULL)
>> +			BUG_ON(proc->p_replen == 0);
>> +	}
>>  
>> -	req->rq_buffer = xprt->ops->buf_alloc(task, bufsiz << 1);
>> -	if (req->rq_buffer != NULL) {
>> -		req->rq_bufsize = bufsiz;
>> +	/*
>> +	 * Calculate the size (in quads) of the RPC call
>> +	 * and reply headers, and convert both values
>> +	 * to byte sizes.
>> +	 */
>> + 	req->rq_callsize = RPC_CALLHDRSIZE + (slack << 1) + proc->p_arglen;
>> + 	req->rq_callsize <<= 2;
>> + 	req->rq_rcvsize = RPC_REPHDRSIZE + slack + proc->p_replen;
>> + 	req->rq_rcvsize <<= 2;
> 
> What happened to rslack?  The callsize calculation should be using
> cslack and the rcvsize calculation rslack, I think, right?

As far as I understood it, cslack is the size of the authentication 
verifier for that flavor.  Shouldn't that be the same for calls and replies?

> In the krb5p case there's an extra annoyance: rslack is used to decide
> where to expect page data to start, so it can only take into account
> extra space needed at the beginning.  But krb5p has to add padding, for
> example, to the end of each request.

That padding has to follow XDR rules, though, correct?

[-- Attachment #2: chuck.lever.vcf --]
[-- Type: text/x-vcard, Size: 265 bytes --]

begin:vcard
fn:Chuck Lever
n:Lever;Chuck
org:Oracle Corporation;Corporate Architecture Linux Projects Group
email;internet:chuck dot lever at nospam oracle dot com
title:Principle Member of Staff
tel;work:+1 248 614 5091
x-mozilla-html:FALSE
version:2.1
end:vcard


[-- Attachment #3: Type: text/plain, Size: 347 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #4: Type: text/plain, Size: 140 bytes --]

_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

  reply	other threads:[~2007-01-24 20:43 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-24 19:17 [PATCH 00/15] patches for 2.6.21 Chuck Lever
2007-01-24 19:19 ` [PATCH 01/15] NFS: fix print format for tk_pid Chuck Lever
2007-01-24 19:19 ` [PATCH 02/15] SUNRPC: fix print format for tk_pid in auth_gss support Chuck Lever
2007-01-24 19:19 ` [PATCH 03/15] SUNRPC: fix print format for tk_pid Chuck Lever
2007-01-24 19:19 ` [PATCH 04/15] SUNRPC: Eliminate side effects from rpc_malloc Chuck Lever
2007-01-24 19:19 ` [PATCH 05/15] SUNRPC: Make rpc_free API more generic Chuck Lever
2007-01-24 19:19 ` [PATCH 06/15] NFS: disconnect before retrying NFSv4 requests over TCP Chuck Lever
2007-01-24 19:20 ` [PATCH 07/15] SUNRPC: introduce rpcbind: replacement for in-kernel portmapper Chuck Lever
2007-01-24 19:20 ` [PATCH 08/15] SUNRPC: switch socket-based RPC transports to use rpcbind Chuck Lever
2007-01-24 19:20 ` [PATCH 09/15] SUNRPC: switch the RPC server to use the new rpcbind registration API Chuck Lever
2007-01-24 19:20 ` [PATCH 10/15] NFS: switch NFSROOT to use new rpcbind client Chuck Lever
2007-01-24 19:20 ` [PATCH 11/15] SUNRPC: remove old portmapper Chuck Lever
2007-01-24 19:20 ` [PATCH 12/15] SUNRPC: RPC client should retry with different versions of rpcbind Chuck Lever
2007-01-24 19:20 ` [PATCH 13/15] SUNRPC: RPC buffer size estimates are too large Chuck Lever
2007-01-24 20:37   ` J. Bruce Fields
2007-01-24 20:41     ` Chuck Lever [this message]
2007-01-24 20:51       ` J. Bruce Fields
2007-01-24 21:09         ` Chuck Lever
2007-01-24 21:25           ` J. Bruce Fields
2007-01-24 21:28             ` Chuck Lever
2007-01-24 20:47   ` J. Bruce Fields
2007-01-24 20:50     ` Chuck Lever
2007-01-24 21:01       ` J. Bruce Fields
2007-01-24 21:11         ` Chuck Lever
2007-01-24 19:20 ` [PATCH 14/15] NLM: Shrink the maximum request size of NLM4 requests Chuck Lever
2007-01-24 19:20 ` [PATCH 15/15] SUNRPC: Debugging aid Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45B7C482.9090807@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=bfields@fieldses.org \
    --cc=nfs@lists.sourceforge.net \
    --cc=trond.myklebust@fys.uio.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox