public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org, nfsv4@linux-nfs.org,
	Jeff Moyer <jmoyer@redhat.com>
Subject: Re: [PATCH 2/3] SUNRPC: Fix the TCP write space reservations for deferred requests
Date: Mon, 24 Aug 2009 17:32:13 -0400	[thread overview]
Message-ID: <20090824213213.GC8532@fieldses.org> (raw)
In-Reply-To: <1245534248.5182.45.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>

On Sat, Jun 20, 2009 at 05:44:08PM -0400, Trond Myklebust wrote:
> On Fri, 2009-06-19 at 18:23 -0400, J. Bruce Fields wrote:
> > On Mon, May 18, 2009 at 05:47:56PM -0400, Trond Myklebust wrote:
> > > Ensure that deferred requests are accounted for correctly by the write
> > > space reservation mechanism. In order to avoid double counting, remove the
> > > reservation when we defer the request, and save any calculated value, so
> > > that we can restore it when the request is requeued.
> > 
> > I like that it does the addition to xpt_reserved in just one place
> > instead of two, and carrying over the reserved_space is nice, but I
> > don't understand the "double accounting" comment--where exactly is
> > something counted twice?
> 
> Correct me if I'm wrong, but as far as I can see, the current code bumps
> xpt_reserved every time you call svc_xprt_enqueue() irrespective of
> whether or not you are going to process a new RPC call, or whether you
> are processing a deferred call.
> 
> In the latter case, there doesn't appear to be any code that subtracts
> from xpt_reserved prior to the re-enqueue process, hence my belief that
> we are double counting those events...

Sorry for the slow response!  The original request is
dropped--cache_check() returns -EAGAIN on queueing up the deferred
request, the caller returns back to svc_process, and the reservation is
removed from xpt_reserved by svc_drop().

And a new reservation isn't made until the deferred request is
revisited, at which point it's treated as any new request received from
a socket would be.

Your patch would instead have the server keep that reservation while the
request is deferred.

I'm not really sure how to decide which is better.

--b.

  parent reply	other threads:[~2009-08-24 21:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-18 21:47 [PATCH 0/3] Fix the Linux rpc-over-tcp server performance Trond Myklebust
     [not found] ` <20090518214756.786.28129.stgit-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-05-18 21:47   ` [PATCH 3/3] SUNRPC: Fix svc_tcp_recvfrom() Trond Myklebust
2010-03-18 21:21     ` J. Bruce Fields
2010-04-02 21:00       ` J. Bruce Fields
2009-05-18 21:47   ` [PATCH 1/3] SUNRPC: Fix the TCP server's send buffer accounting Trond Myklebust
     [not found]     ` <20090518214756.786.58191.stgit-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-06-19  3:06       ` J. Bruce Fields
2009-05-18 21:47   ` [PATCH 2/3] SUNRPC: Fix the TCP write space reservations for deferred requests Trond Myklebust
     [not found]     ` <20090518214756.786.33956.stgit-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-06-19 22:23       ` J. Bruce Fields
2009-06-20 21:44         ` Trond Myklebust
     [not found]           ` <1245534248.5182.45.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-08-24 21:32             ` J. Bruce Fields [this message]
2009-05-19 15:14   ` [PATCH 0/3] Fix the Linux rpc-over-tcp server performance Jeff Moyer
2009-08-12  2:43 ` J. Bruce Fields
2009-08-12 13:22   ` Jeff Moyer
2009-08-12 14:20     ` J. Bruce Fields
2009-08-12 17:02       ` Jeff Moyer
2009-08-12 22:32         ` J. Bruce Fields
2009-08-12 22:40           ` Trond Myklebust
2009-08-13 13:05           ` Jeff Moyer

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=20090824213213.GC8532@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=Trond.Myklebust@netapp.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=nfsv4@linux-nfs.org \
    /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