From: NeilBrown <neilb@suse.de>
To: Rob Landley <rlandley@parallels.com>
Cc: <linux-nfs@vger.kernel.org>
Subject: Re: CACHE_NEW_EXPIRY is 120, nextcheck initialized to 30*60=1800?
Date: Wed, 23 Feb 2011 08:07:31 +1100 [thread overview]
Message-ID: <20110223080731.6c013be2@notabene.brown> (raw)
In-Reply-To: <4D63BAA0.3090505@parallels.com>
On Tue, 22 Feb 2011 07:31:12 -0600 Rob Landley <rlandley@parallels.com> wrote:
> In net/sunrpc/cache.c line 416 or so (function cache_clean()) there's
> this bit:
>
> else {
> current_index = 0;
> current_detail->nextcheck = seconds_since_boot()+30*60;
> }
>
> The other uses of seconds_since_boot() add CACHE_NEW_EXPIRY (which is
> 120). This is A) more than ten times that, B) a magic inline constant.
>
> Is there a reason for this? (Some subtle cache lifetime balancing thing?)
Apples and oranges are both fruit, but don't taste the same...
'nextcheck' is when to next clean old data out of the cache. There is no
rush to remove this data, it is just about freeing up memory. So every
half hour is fine. Sometimes an immediate flush is called if there is a
pressing need to remove stuff, but by default, occasional is enough.
CACHE_NEW_EXPIRY is the expiry time for cache entries that are incomplete and
have not yet been filled-in by a down-call. When user-space fills in a cache
entry it gets an expiry time, typically half and hour I think, though that
is up to user-space. If no down-call arrive for 120 seconds we forget about
it. I don't recall the exact point of this - maybe it is to encourage a new
up-call..
But I agree that the 30*60 should be a #defined constant. Patches welcome :-)
NeilBrown
next prev parent reply other threads:[~2011-02-22 21:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-22 13:31 CACHE_NEW_EXPIRY is 120, nextcheck initialized to 30*60=1800? Rob Landley
2011-02-22 21:07 ` NeilBrown [this message]
2011-02-23 3:59 ` Rob Landley
2011-02-23 5:53 ` NeilBrown
2011-02-23 19:27 ` NFS in containers Rob Landley
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=20110223080731.6c013be2@notabene.brown \
--to=neilb@suse.de \
--cc=linux-nfs@vger.kernel.org \
--cc=rlandley@parallels.com \
/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;
as well as URLs for NNTP newsgroup(s).