From: Neil Brown <neilb@suse.de>
To: Steve Dickson <SteveD@redhat.com>
Cc: nfs@lists.sourceforge.net, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH][RFC] NFS: Improving the access cache
Date: Wed, 26 Apr 2006 14:55:21 +1000 [thread overview]
Message-ID: <17486.64825.942642.594218@cse.unsw.edu.au> (raw)
In-Reply-To: message from Steve Dickson on Tuesday April 25
On Tuesday April 25, SteveD@redhat.com wrote:
> Currently the NFS client caches ACCESS information on a per uid basis
> which fall apart when different process with different uid consistently
> access the same directory. The end result being a storm of needless
> ACCESS calls...
>
> The attached patch used a hash table to store the nfs_access_entry
> entires which cause the ACCESS request to only happen when the
> attributes timeout.. The table is indexed by the addition of the
> nfs_inode pointer and the cr_uid in the cred structure which should
> spread things out nicely for some decent scalability (although the
> locking scheme may need to be reworked a bit). The table has 256 entries
> of struct list_head giving it a total size of 2k.
>
> The patch is based on Trond's GIT tree...
>
> Comments?
- There is no upper bound imposed on the size of the cache, and no way
for memory pressure to shrink the cache except indirectly by
discarding inodes.
I cannot see this being exploitable as getting access to lots of
credentials would be hard for any given user. However I feel that
some cleaning might be in order.
- The nfs_zap_access_cache call isn't cheap. If that could be
amortised somehow it would be good. Maybe use some version tagging
so that when an inode is reused the access entry will no longer
match in some way. Then just clean the table by periodic scans that
discard based on timeout information ?
It occurs to me that the large majority of inodes will only be
accessed by a single user and so need not reside in the cache.
So how about having a single "struct nfs_access_entry" pointer in the
inode.
When we do a lookup we look there first.
When we want to add an entry, we try to add it there first.
When we end up with two current access entries for the same inode,
only then do we insert them into the hash.
We would need to be able to tell from the inode whether anything is
hashed or not. This could simply be if the nfs_access_entry point is
non-null, and its hashlist it non-empty. Or we could just use a bit
flag somewhere.
I suspect this would keep the cache much smaller, and some of my other
concerns might then become irrelevant.
NeilBrown
next prev parent reply other threads:[~2006-04-26 4:55 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 [this message]
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
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=17486.64825.942642.594218@cse.unsw.edu.au \
--to=neilb@suse.de \
--cc=SteveD@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--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).