From: Peter Staubach <staubach@redhat.com>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: uketinen@us.ibm.com, nfs@lists.sourceforge.net
Subject: Re: NFS dentry caching mechanism
Date: Fri, 27 Jan 2006 10:36:45 -0500 [thread overview]
Message-ID: <43DA3E0D.70007@redhat.com> (raw)
In-Reply-To: <1138374819.8712.53.camel@lade.trondhjem.org>
Trond Myklebust wrote:
>On Fri, 2006-01-27 at 09:43 -0500, Peter Staubach wrote:
>
>
>>With no negative cache, you get LOOKUP operations which are most likely
>>all going to fail. With the negative cache, you can trade these failed
>>LOOKUP operations for GETATTR operations for a net win in CPU on both
>>the client and the server and also in network utilization because the
>>GETATTR requests and responses are smaller than the LOOKUP requests and
>>responses. You can also retain the consistency semantics to be as
>>correct as possible.
>>
>>
>
>On a Linux server, the lookup and getattr have roughly the same overhead
>since the server has to set up dentries for them.
>
>
>
On most other servers that I have seen, the file handle is translated to
something like a vnode. For a LOOKUP, a VOP_LOOKUP and then a VOP_GETATTR
is done as part of the processing for the post operation attributes. For
a GETATTR, only the VOP_GETATTR is done.
For Linux servers, the cost may be a wash, but for others, there is a
difference. If we exploit that difference, then everything is better.
>>Read-only file systems are treated differently because it seems a
>>fairly safe assumption that a file system which is read-only to a client
>>is probably changing slowly and thus, the normal attribute caching
>>mechanism is probably sufficient.
>>
>>If only we knew that a file system was read-only throughout the entire
>>path and then we could eliminate all of the consistency checks... :-)
>>
>>
>
>The v4.1 draft w/ the spec for directory delegations is approaching
>final form.
>
>
>
Cool!
>>>Furthermore, in cases such as the one that Usha describes, we don't
>>>actually _care_ about revalidating a negative dentry and/or looking up a
>>>new dentry. Do it using intents, and you can probably skip all the crap
>>>in nfs_lookup_revalidate+nfs_lookup: after all you need in order to send
>>>a valid RMDIR command is the filehandle of the parent, and a name.
>>>
>>>
>>>
>>Well, yes, this would address this one particular aspect, but does not solve
>>the more general problem. Bad things can occur when the kernel tells an
>>application that a file does not exist, when it truly does. This is bad
>>because the application can not discover the difference. Telling an
>>application that a file does exist when it does not is not quite so bad
>>because the application can discover the difference.
>>
>>
>
>I'm not sure I understand what you mean here. We have exclusive create
>semantics on most operations that need them, so the application can
>definitely discover the difference in those cases.
>
>
>
The situation that I usually think of can be something like a software
development environment which uses a distributed make scheme to use
multiple machines to build. All machines in the environment use NFS to
mount the source and build target spaces.
First, the master decides that it needs to build foo.o from foo.c. It
looks for the existence of foo.o, but it does not exist yet. The NFS
client on the master then creates a negative entry for foo.o. The master
then farms out a compile on one of the slave build servers. This system
compiles foo.c into foo.o and informs the master that the compile is done.
The build process on the master then attempts to use foo.o, but because of
the negative cache entry, is told that the file still does not exist.
Oops.
With close-to-open consistency and no negative caching, this should work
as expected. With negative caching and strong cache validation on the
negative entries, this should also work as expected. With negative caching
and the relaxed cache validation, then this probably won't work because the
compile will probably be faster then the timeout value which controls the
negative entries.
>Operations such as RMDIR and unlink() do have a race, but in the case
>where you have one client creating a directory and another client
>destroying it, there will always be a race unless you have some method
>of synchronisation between the processes on the clients.
>
>There is a potential caching race if you try to open the file, but that
>is (as I said previously) quite intentional: it is done for scalability
>reasons.
>
>
>
I don't think that I understand this last paragraph. Does this mean that
the consistency was purposefully relaxed in order to increase performance?
I think that it would have been nice to get all of the perceived possible
benefits from the negative cache entries, but in practice, I don't think
that the benefits outweigh the possible negative aspects.
Thanx...
ps
>>This situation could be addressed as described, but I suspect that we just
>>end up in the next situation and eventually needing to fix the problem for
>>real.
>>
>>
>
>Note that we already use intents in order to eliminate the need for
>negative dentry validation for the case of O_EXCL opens. We could
>probably do the same for mkdir(), symlink() and link() (for the case of
>the target). That would fix the issue where you do have some method of
>synchronisation between the clients.
>
>Cheers,
> Trond
>
>
>
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
next prev parent reply other threads:[~2006-01-27 15:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-26 22:40 NFS dentry caching mechanism Usha Ketineni
2006-01-26 23:14 ` Trond Myklebust
2006-01-27 13:38 ` Peter Staubach
2006-01-27 13:44 ` Trond Myklebust
2006-01-27 13:49 ` Peter Staubach
2006-01-27 14:26 ` Trond Myklebust
2006-01-27 14:43 ` Peter Staubach
2006-01-27 15:13 ` Trond Myklebust
2006-01-27 15:36 ` Peter Staubach [this message]
2006-01-27 17:13 ` Trond Myklebust
2006-01-27 18:20 ` Peter Staubach
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=43DA3E0D.70007@redhat.com \
--to=staubach@redhat.com \
--cc=nfs@lists.sourceforge.net \
--cc=trond.myklebust@fys.uio.no \
--cc=uketinen@us.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.