linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: David Howells <dhowells@redhat.com>,
	"J. Bruce Fields" <bfields@fieldses.org>
Cc: linux-fsdevel@vger.kernel.org, lsf-pc@lists.linux-foundation.org,
	jaltman@auristor.com
Subject: Re: [Lsf-pc] [LSF/MM TOPIC] Network filesystem cache management system call
Date: Fri, 20 Jan 2017 11:53:13 -0500	[thread overview]
Message-ID: <1484931193.2807.2.camel@redhat.com> (raw)
In-Reply-To: <14114.1484671351@warthog.procyon.org.uk>

On Tue, 2017-01-17 at 16:42 +0000, David Howells wrote:
> J. Bruce Fields <bfields@fieldses.org> wrote:
> 
> > > One of these is the call to manage local caching on a file or volume.
> > > This, however, doesn't really need to be limited to AFS, but could also be
> > > applicable to NFS, CIFS, etc. - and possibly even to local filesystems.
> > 
> > Do you have a summary of the AFS interface to give an idea what's
> > needed?
> 
> I have the pioctls listed here that I need to emulate:
> 
> 	https://www.infradead.org/~dhowells/kafs/user_interface.html
> 
> along with my thoughts on how to do that.
> 
> For cache wangling, I was thinking of something like:
> 
> 	fcachectl(int dirfd,
> 		  const char *pathname,
> 		  unsigned atflags,
> 		  const char *cmd,
> 		  char *result,
> 		  size_t *result_len);
> 

I think it might be more useful to wire posix_fadvise into the
filesystem drivers somehow. A hinting interface really seems like the
right approach here, given the differences between different
filesystems.
 
> The relevant pioctls are:
> 
>  (*) VIOCGETCACHEPARMS
> 
>      Get the size of the cache.
> 

Global or per-inode cache?

>  (*) VIOCSETCACHESIZE
> 
>      Set the cache size.
> 
>  (*) VIOCFLUSH
> 
>      Invalidate the cached information for an object, both the inode/dentry
>      structs and anything in the local cache.
> 

Maybe POSIX_FADV_DONTNEED ?

>  (*) VIOCFLUSHCB
> 
>      Invalidate any callbacks/leases outstanding on an object.  This might
>      make more sense to be done via the same mechanism as lease/lock
>      management.
> 

Well...just because we have a delegation or layout on NFS, that doesn't
mean we'll have any sort of client VFS-layer lease.

I guess you could use this on NFS to force the client to drop a
delegation or layout? That could be useful.


>  (*) VIOC_FLUSHVOLUME
> 
>      Flush all cached state for a volume, both from RAM and local disk cache
>      as far as possible.  Files that are open aren't necessarily affected.
> 

Maybe POSIX_FADV_DONTNEED on the mountpoint?

>  (*) VIOC_FLUSHALL
> 
>      FLush all cached state for all volumes.
> 

How would you implement that in a generic way? Suppose I have a mix of
AFS and NFS mountpoints and issue this via some mechanism. Is
everything going to drop their caches?

Might want to punt on this one or do it with a private, AFS-only ioctl.


>  (*) VIOCPREFETCH
> 
>      Prefetch a file into the cache.
> 

POSIX_FADV_WILLNEED ?

> So, maybe:
> 
> 	fcachectl(AT_FDCWD,
> 		  "/afs/user/dhowells",
> 		  0,
> 		  "flush volume",
> 		  NULL, NULL);
> 
> to flush an AFS volume containing my home directory.
> 
> Note that doing this by fcntl() or ioctl() has potential difficulties as it
> would have to work on non-file objects such as device files or symlinks.
> 

Does AFS allow remote access to devices a'la CIFS?

Could we allow posix_fadvise on O_PATH opens? For symlinks there is
always O_NOFOLLOW.

> Other functions that this could be used for are cache pinning and
> fixup/integration should we ever want disconnected operation.
> 

Yeah, a lot of possibilities there.

-- 
Jeff Layton <jlayton@redhat.com>

  reply	other threads:[~2017-01-20 16:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-06 22:40 [LSF/MM TOPIC] Network filesystem cache management system call David Howells
2017-01-06 23:18 ` Andreas Dilger
2017-01-07 14:27   ` [Lsf-pc] " Jeff Layton
2017-01-13 17:16 ` J. Bruce Fields
2017-01-15 23:36 ` Oleg Drokin
2017-01-17 16:42 ` David Howells
2017-01-20 16:53   ` Jeff Layton [this message]
2017-01-20 17:45   ` [Lsf-pc] " David Howells
2017-01-20 18:08     ` Jeff Layton
2017-01-17 16:49 ` David Howells
2017-01-18 20:12   ` Jeffrey Altman
2017-01-19 14:48   ` David Howells
2017-01-20  4:32     ` Jeffrey Altman

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=1484931193.2807.2.camel@redhat.com \
    --to=jlayton@redhat.com \
    --cc=bfields@fieldses.org \
    --cc=dhowells@redhat.com \
    --cc=jaltman@auristor.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=lsf-pc@lists.linux-foundation.org \
    /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).