From: Chuck Lever <cel@citi.umich.edu>
To: Neil Brown <neilb@suse.de>
Cc: Steve Dickson <SteveD@redhat.com>,
nfs@lists.sourceforge.net, linux-fsdevel@vger.kernel.org
Subject: Re: [NFS] Re: [PATCH][RFC] NFS: Improving the access cache
Date: Sun, 07 May 2006 23:23:16 -0400 [thread overview]
Message-ID: <445EB9A4.2080705@citi.umich.edu> (raw)
In-Reply-To: <17502.45182.130630.119304@cse.unsw.edu.au>
Neil Brown wrote:
> On Wednesday May 3, cel@citi.umich.edu wrote:
>> For the sake of discussion, let me propose some design alternatives.
>>
>> 1. We already have cache shrinkage built in: when an inode is purged
>> due to cache shrinkage, the access cache for that inode is purged as
>> well. In other words, there is already a mechanism for external memory
>> pressure to shrink this cache. I don't see a strong need to complicate
>> matters by adding more cache shrinkage than already exists with normal
>> inode and dentry cache shrinkage.
>
> If you have one particular file that is used regularly - and so never
> falls out of cache - and is used occasionally by every single user in
> your system, then that one inode could contribute to thousands of
> access cache items that will never be purged.
I speculate that this would not be a problem.
First, each entry in the cache is not going to be very large. For the
sake of easy math, let's say each one is 32 bytes. One hundred thousand
of these is a little more than 3MB. Or, say we have ten thousand files
with 10 different access cache entries: again, that's just about 3MB.
(Naturally I'm ignoring the slab accounting overhead).
Even a single-user system these days is going to have a gigabyte or more
of RAM, so we're talking less than a percent of memory tied up in this
case. Three megabytes is probably less memory than a single Gnome
application uses for its working set.
I'm always told to start with a design that is as simple as possible
(and no simpler) and build on it only when I find a problem; this avoids
overdesign. I don't see a compelling reason to start with a complicated
design here, and there are good reasons to keep it simple.
If allowing the access cache to grow potentially without bounds still
makes you nervous, I maintain that we still want to avoid a global LRU.
Having an LRU _per-inode_ might be a simple way to limit the amount of
memory that is consumed without the locking and management overhead of a
global LRU. If entries haven't been accessed in more than actimeo
seconds, then purge them; we'll have to go back to the server to
revalidate such entries anyway, so there's no reason to keep them around.
It is pretty cheap to release, say, the two oldest entries every time
you try an access, provided they have not been touched in actimeo seconds.
--
corporate: <cel at netapp dot com>
personal: <chucklever at bigfoot dot com>
next prev parent reply other threads:[~2006-05-08 3:22 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-26 1:14 [PATCH][RFC] NFS: Improving the access cache Steve Dickson
2006-04-26 1:31 ` Matthew Wilcox
2006-04-26 4:55 ` Neil Brown
2006-04-26 14:51 ` Steve Dickson
2006-04-26 22:32 ` Neil Brown
2006-05-02 9:49 ` Steve Dickson
2006-05-02 13:51 ` [NFS] " Peter Staubach
2006-05-02 14:38 ` Steve Dickson
2006-05-02 14:51 ` Peter Staubach
2006-05-02 15:26 ` [NFS] " Ian Kent
2006-05-03 4:42 ` Chuck Lever
2006-05-05 14:07 ` Steve Dickson
2006-05-05 14:53 ` Peter Staubach
2006-05-05 14:59 ` Peter Staubach
2006-05-06 14:35 ` [NFS] " Steve Dickson
2006-05-08 14:07 ` Peter Staubach
2006-05-08 17:09 ` Trond Myklebust
2006-05-08 17:20 ` Peter Staubach
2006-05-08 2:44 ` Neil Brown
2006-05-08 3:23 ` Chuck Lever [this message]
2006-05-08 3:28 ` Neil Brown
2006-04-26 13:03 ` Trond Myklebust
2006-04-26 13:14 ` Peter Staubach
2006-04-26 14:01 ` Trond Myklebust
2006-04-26 14:15 ` Peter Staubach
2006-04-26 15:44 ` Trond Myklebust
2006-04-26 17:01 ` Peter Staubach
2006-04-26 15:03 ` Steve Dickson
2006-04-26 13:17 ` [NFS] " Chuck Lever
2006-04-26 14:19 ` Steve Dickson
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=445EB9A4.2080705@citi.umich.edu \
--to=cel@citi.umich.edu \
--cc=SteveD@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=neilb@suse.de \
--cc=nfs@lists.sourceforge.net \
/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).