public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: linux-kernel@vger.kernel.org
Subject: Re: NFS and kernel 2.6.x
Date: Tue, 20 Apr 2004 01:09:32 +0100	[thread overview]
Message-ID: <20040420000932.GA15220@mail.shareable.org> (raw)
In-Reply-To: <1082389088.2559.34.camel@lade.trondhjem.org>

Trond Myklebust wrote:
> > I agree, but would still prefer more consistent behaviour if it is
> > easy -- and I explained how to do it, it's an easy algorithm.
> 
> The reason I don't like it is that it continues to tie the major timeout
> to the resend timeouts. You've convinced me that they should not be the
> same thing.

Sorry, I don't understand that paragraph.

The algorithm I suggested _decouples_ the major timeout from the rtt
estimate.  Your algorithm strongly couples them.  I'm not sure what
you mean by saying the major timeout is "tied to the resend timeouts".

Your current (patched) algorithm sets the major timeout to be in the
range:

     [timeo << retrans, (timeo << retrans) * 2]

The suggested algorithm sets the major timeout to be in the range:

     [timeo << (retrans+1), (timeo << (retrans+1)) + 2 * timeo)

I.e. with retrans set to a new default of 5 (I think that's useful),
the major timeout is approx [44.8, 46] instead of [22.4, 44.8].

I agree it's not the most important thing in the world, but it is nice
to be able to fix the parameters and say that with the defaults, major
timeout happens after about 45 seconds.

You say you don't like it because major timeout is still tied to
something.  Could you explain what the ideal behaviour you have in
mind is?  Right now, with the patch, I think your intention is to have
a fixed major timeout time, but it doesn't work like that.

> The other reason is that it only improves matters for the first request.
> Once we reset the RTO, all those other outstanding requests are anyway
> going to see an immediate discontinuity as their basic timeout jumps
> from 1ms to 700ms.

Yes, that's the point: after a retransmits passes a threshold, we
should no longer depend on the RTO estimate because it doesn't seem to
be reliable.

> So why go to all that trouble just for 1 request?

Because it's visible behaviour with "soft" mounts.  Someone unplugs
the cable or the network is down, and you see the I/O errors after
about 40 seconds.  This is nicer than seeing them after an unknown
period between 40 and 80 (or 20 and 40 depending on your settings).

> It was partly another "consistency" issue that initially worried me,
> partly in order to avoid problems with overflow:
> If you have more than one outstanding request, then those that get
> scheduled after the first major timeout (when we reset the RTO
> estimator) will see a "jump". If the "retries" variable is too large,
> they will either jump straight over 60 seconds, and thus trigger the cap
> or they will end up at zero due to 32-bit overflow.

Ah.  So you keep track of the number of retries per request, and each
time you send a request you set its timeout to (RTO << retries)?

If you do, maybe that's why my algorithm seems over complicated, and
you're concerned about overflows etc.

Instead of counting retries, don't.  You don't need a per-request
retries counter.  Instead: keep track of the request_timeout when the
request was last issued.  When retransmitting, compare that value
against the global value (timeo << retrans).  When a request times out
and request_timeout >= (timeo << retrans), that's a major timeout.
Otherwise you just check if request_timeout < timeo.  If yes, double
it.  If no, set request_timeout = timeo << N for the smallest integer
N such that it's an increase.  And try again.

Notice how that logic is based on constants: it's independent of RTO,
and so outstanding requests aren't affected by changes in RTO.
There's no jump, no overflow, and you can compute the key constant
(timeo << retrans) when initialising: retrans isn't used by itself.

-- Jamie


  parent reply	other threads:[~2004-04-20  0:09 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-16  1:14 NFS and kernel 2.6.x Charles Shannon Hendrix
2004-04-16  1:31 ` Trond Myklebust
2004-04-16  1:53   ` Andrew Morton
2004-04-16  2:54     ` Trond Myklebust
2004-04-16  4:59       ` Phil Oester
2004-04-16  5:29         ` Trond Myklebust
2004-04-16  7:13           ` Paul Wagland
2004-04-16 14:44           ` Marcelo Tosatti
2004-04-16 14:46             ` Marcelo Tosatti
2004-04-16 15:50             ` Trond Myklebust
2004-04-16 15:55             ` Dave Gilbert (Home)
2004-04-16 16:13               ` Trond Myklebust
2004-04-16 19:07                 ` Daniel Egger
2004-04-17  4:56                   ` Chris Friesen
2004-04-17  9:56                     ` Daniel Egger
2004-04-17  5:24                   ` Trond Myklebust
2004-04-17 14:15                     ` Daniel Egger
2004-04-16 19:11                 ` Charles Shannon Hendrix
2004-04-17 16:44           ` Matthias Urlichs
2004-04-17 18:15             ` Trond Myklebust
2004-04-17 18:32               ` Marc Singer
2004-04-17 18:58                 ` Trond Myklebust
2004-04-17 19:01                   ` Marc Singer
2004-04-17 19:09                     ` Trond Myklebust
2004-04-17 19:19                       ` Russell King
2004-04-18  2:51                         ` Trond Myklebust
2004-04-19 16:39                           ` Trond Myklebust
2004-04-19 21:10                             ` Trond Myklebust
2004-04-17 22:22                   ` Marc Singer
2004-04-18  0:57                     ` Trond Myklebust
2004-04-18  5:01                       ` Marc Singer
2004-04-18  6:36                         ` Chris Friesen
2004-04-18  7:56                           ` Russell King
2004-04-18 17:31                             ` Marc Singer
2004-04-17 19:01                 ` Daniel Egger
2004-04-17 20:22                   ` Marc Singer
2004-04-18 11:14                     ` Daniel Egger
2004-04-19  9:06             ` Helge Hafting
2004-04-16  9:03     ` Jamie Lokier
2004-04-16 15:55       ` Trond Myklebust
2004-04-16 18:48         ` Jamie Lokier
2004-04-16 19:06           ` Trond Myklebust
2004-04-16 19:39             ` Jamie Lokier
2004-04-17 22:32               ` Trond Myklebust
2004-04-18  3:26                 ` Jamie Lokier
2004-04-18  7:03                   ` Trond Myklebust
2004-04-18 23:22                     ` Jamie Lokier
2004-04-19 15:38                       ` Trond Myklebust
2004-04-19 16:19                         ` Trond Myklebust
2004-04-20  0:09                         ` Jamie Lokier [this message]
     [not found]   ` <20040416190126.GB408@widomaker.com>
     [not found]     ` <1082144608.2581.156.camel@lade.trondhjem.org>
     [not found]       ` <20040417000353.GA3750@widomaker.com>
2004-04-17  5:28         ` Trond Myklebust
2004-04-17 17:55           ` Charles Shannon Hendrix
2004-04-17 18:55             ` Trond Myklebust
     [not found] <1Lql8-6O3-1@gated-at.bofh.it>
     [not found] ` <1LquO-6TK-5@gated-at.bofh.it>
     [not found]   ` <1LqOg-76p-19@gated-at.bofh.it>
     [not found]     ` <1LrKo-7Sn-21@gated-at.bofh.it>
     [not found]       ` <1LtM3-12d-5@gated-at.bofh.it>
     [not found]         ` <1Luf2-1kK-1@gated-at.bofh.it>
     [not found]           ` <1LDBL-uY-3@gated-at.bofh.it>
2004-04-16 20:31             ` Andi Kleen

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=20040420000932.GA15220@mail.shareable.org \
    --to=jamie@shareable.org \
    --cc=linux-kernel@vger.kernel.org \
    --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