All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: nfs@lists.sourceforge.net
Subject: Re: [PATCH 12/14] SUNRPC: RPC buffer size estimates are too large
Date: Tue, 23 Jan 2007 11:04:21 -0500	[thread overview]
Message-ID: <45B63205.1070801@oracle.com> (raw)
In-Reply-To: <1169248351.6262.55.camel@lade.trondhjem.org>

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

Trond Myklebust wrote:
> On Fri, 2007-01-19 at 17:46 -0500, Chuck Lever wrote:
>> Trond Myklebust wrote:
>>> On Thu, 2007-01-18 at 18:30 -0500, Chuck Lever wrote:
>>>> The RPC buffer size estimation logic in net/sunrpc/clnt.c always
>>>> significantly overestimates the requirements for the buffer size.
>>>> A little instrumentation demonstrated that in fact rpc_malloc was never
>>>> allocating the buffer from the mempool, but almost always called kmalloc.
>>>>
>>>> To compute the size of the RPC buffer more precisely, split p_bufsiz into
>>>> two fields; one for the argument size, and one for the result size.  The
>>>> goal is to keep the size requirement for RPC buffers at or below 2KiB.
>>>>
>>>> So now we will compute the sum of the exact call and reply header sizes,
>>>> and split the RPC buffer precisely between the two.  That should keep all
>>>> RPCs within the 2KiB buffer mempool limit.
>>> How about adding a temporary BUG_ON() into call_allocate to ensure
>>> task->tk_msg.rpc_proc->p_arglen is always non-zero. We also want to
>>> check for non-zero values of task->tk_msg.rpc_proc->p_replen when
>>> task->tk_msg.rpc_proc->p_decode is non-null.
>> Hmmm.  A sanity check is reasonable, but do we really want a runtime 
>> check for values that are fixed at compile time?  I'm also not in love 
>> with BUG_ON() -- maybe something like aborting the task and printing a 
>> console warning would be less disruptive.
> 
> How is that less disruptive? A bug by any other name....

Depending on what locks or semaphores are held at the time the bug 
trips, it could freeze up the whole system.  If we cleanly abort the 
faulty RPC, that localizes the failure without affecting the rest of the 
system.

> The point is just to make sure that all existing structures have been
> converted and that we haven't missed anything. Feel free to queue up a
> patch for the release after this patch has been merged in order to
> remove it.

OK.

>>> Finally, what is the purpose of req->rq_callsize and req->rq_rcvsize?
>>> They don't appear to be used anywhere.
>> In my code, they are used in call_encode and xprt_release in addition to 
>> call_allocate.  They basically replace rq_bufsize.
> 
> In that case, why not just add them in the patch that contains the code
> that uses them?

I'm not sure why you don't have those hunks.  They should be in the same 
patch.  I'm going to resend these patches sometime today or tomorrow.

[-- Attachment #2: chuck.lever.vcf --]
[-- Type: text/x-vcard, Size: 276 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-23 16:06 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-18 23:23 [PATCH 00/14] NFS/RPC client patches for 2.6.21 Chuck Lever
2007-01-18 23:29 ` [PATCH 01/14] NFS: fix print format for tk_pid Chuck Lever
2007-01-19  0:03   ` Christoph Hellwig
2007-01-19  0:10     ` Chuck Lever
2007-01-18 23:29 ` [PATCH 02/14] SUNRPC: fix print format for tk_pid in auth_gss support Chuck Lever
2007-01-18 23:29 ` [PATCH 03/14] SUNRPC: fix print format for tk_pid Chuck Lever
2007-01-18 23:29 ` [PATCH 04/14] SUNRPC: Eliminate side effects from rpc_malloc Chuck Lever
2007-01-18 23:30 ` [PATCH 05/14] SUNRPC: Make rpc_free API more generic Chuck Lever
2007-01-18 23:30 ` [PATCH 06/14] SUNRPC: introduce rpcbind: replacement for in-kernel portmapper Chuck Lever
2007-01-19  0:09   ` Christoph Hellwig
2007-01-19 21:54     ` Chuck Lever
2007-01-18 23:30 ` [PATCH 07/14] SUNRPC: switch socket-based RPC transports to use rpcbind Chuck Lever
2007-01-18 23:30 ` [PATCH 08/14] SUNRPC: switch the RPC server to use the new rpcbind registration API Chuck Lever
2007-01-18 23:30 ` [PATCH 09/14] NFS: switch NFSROOT to use new rpcbind client Chuck Lever
2007-01-18 23:30 ` [PATCH 10/14] SUNRPC: Enable support for rpcbind versions 3 and 4 via CONFIG options Chuck Lever
2007-01-19  0:11   ` Christoph Hellwig
2007-01-19 22:04     ` Chuck Lever
2007-01-19 22:10       ` Trond Myklebust
2007-01-18 23:30 ` [PATCH 11/14] SUNRPC: remove old portmapper Chuck Lever
2007-01-18 23:30 ` [PATCH 12/14] SUNRPC: RPC buffer size estimates are too large Chuck Lever
2007-01-18 23:49   ` J. Bruce Fields
2007-01-18 23:54     ` Chuck Lever
2007-01-19  0:00       ` J. Bruce Fields
2007-01-19  0:08         ` Chuck Lever
2007-01-19 22:36   ` Trond Myklebust
2007-01-19 22:46     ` Chuck Lever
2007-01-19 23:12       ` Trond Myklebust
2007-01-23 16:04         ` Chuck Lever [this message]
2007-01-18 23:30 ` [PATCH 13/14] NLM: Shrink the maximum request size of NLM4 requests Chuck Lever
2007-01-19  0:13   ` Christoph Hellwig
2007-01-19 22:27     ` Chuck Lever
2007-01-20  9:26       ` Christoph Hellwig
2007-01-18 23:31 ` [PATCH 14/14] SUNRPC: Debugging aid Chuck Lever
2007-01-19 22:28   ` Trond Myklebust
2007-01-19 22:38     ` 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=45B63205.1070801@oracle.com \
    --to=chuck.lever@oracle.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.