Re: NFSv4/pNFS possible POSIX I/O API standards

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2006-12-01 at 10:42 -0800, Sage Weil wrote:
> On Fri, 1 Dec 2006, Trond Myklebust wrote:
> > I'm quite happy with a proposal for a statlite(). I'm objecting to
> > readdirplus() because I can't see that it offers you anything useful.
> > You haven't provided an example of an application which would clearly
> > benefit from a readdirplus() interface instead of readdir()+statlite()
> > and possibly some tools for managing cache consistency.
> 
> Okay, now I think I understand where you're coming from.
> 
> The difference between readdirplus() and readdir()+statlite() is that 
> (depending on the mask you specify) statlite() either provides the "right" 
> answer (ala stat()), or anything that is vaguely "recent."  readdirplus() 
> would provide size/mtime from sometime _after_ the initial opendir() call, 
> establishing a useful ordering.  So without readdirplus(), you either get 
> readdir()+stat() and the performance problems I mentioned before, or 
> readdir()+statlite() where "recent" may not be good enough.
> 
> Instead of my previous example of proccess #1 waiting for process #2 to 
> finish and then checking the results with stat(), imagine instead that #1 
> is waiting for 100,000 other processes to finish, and then wants to check 
> the results (size/mtime) of all of them.  readdir()+statlite() won't 
> work, and readdir()+stat() may be pathologically slow.
> 
> Also, it's a tiring and trivial example, but even the 'ls -al' scenario 
> isn't ideally addressed by readdir()+statlite(), since statlite() might 
> return size/mtime from before 'ls -al' was executed by the user.

stat() will do the same.

> One can 
> easily imagine modifying a file on one host, then doing 'ls -al' on 
> another host and not seeing the effects.  If 'ls -al' can use 
> readdirplus(), it's overall application semantics can be preserved without 
> hammering large directories in a distributed filesystem.

So readdirplus() would not even be cached? Yech!

> > I agree that an interface which allows a userland process offer hints to
> > the kernel as to what kind of cache consistency it requires for file
> > metadata would be useful. We already have stuff like posix_fadvise() etc
> > for file data, and perhaps it might be worth looking into how you could
> > devise something similar for metadata.
> > If what you really want is for applications to be able to manage network
> > filesystem cache consistency, then why not provide those tools instead?
> 
> True, something to manage the attribute cache consistency for statlite() 
> results would also address the issue by letting an application declare how 
> weak it's results are allowed to be.  That seems a bit more awkward, 
> though, and would only affect statlite()--the only call that allows weak 
> consistency in the first place.  In contrast, readdirplus maps nicely onto 
> what filesystems like NFS are already doing over the wire.

Currently, you will never get anything other than weak consistency with
NFS whether you are talking about stat(), access(), getacl(),
lseek(SEEK_END), or append(). Your 'permitting it' only in statlite() is
irrelevant to the facts on the ground: I am not changing the NFS client
caching model in any way that would affect existing applications.

Cheers
  Trond

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux