From: Jeff Layton <jlayton@redhat.com>
To: David Howells <dhowells@redhat.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
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 13:08:05 -0500 [thread overview]
Message-ID: <1484935685.2807.6.camel@redhat.com> (raw)
In-Reply-To: <5514.1484934316@warthog.procyon.org.uk>
On Fri, 2017-01-20 at 17:45 +0000, David Howells wrote:
> Jeff Layton <jlayton@redhat.com> wrote:
>
> > 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 main reason I'm against using an fd-taking interface is that the object to
> be affected might not be a regular file and could even be mounted over.
>
How would you disambiguate the mounted-over case with a path-based
interface?
> > > (*) VIOCGETCACHEPARMS
> > >
> > > Get the size of the cache.
> > >
> >
> > Global or per-inode cache?
>
> I think this would have to be whatever cache the target inode is lurking
> within. fscache permits multiple caches on a system.
>
Ok, but does this tell you "how big is this entire cache?" or "how much
cache does this inode currently consume" ? Both 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?
>
> Ugh. No. How would you differentiate flushing just the mountpoint or the
> root dir from flushing the volume? Also, you cannot open the mountpoint
> object if it is mounted over.
>
Good point.
I don't know...this kind of thing might be better suited to a sysfs-
style interface, honestly. Anything where you're dealing at the level
of an entire fs doesn't benefit much from a per-inode syscall
interface. That said, that could get messy once you start dealing with
namespaces and such.
> Also POSIX_FADV_DONTNEED is a hint that an application no longer needs the
> data and is not a specifically a command to flush that data.
>
> > > (*) 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.
>
> Might be worth making it AFS-only. Possibly it would make sense to implement
> it in userspace using VIOC_FLUSHVOLUME and iterating over /proc/mounts, but
> that then begs the question of whether this should be affected by namespaces.
>
> > POSIX_FADV_WILLNEED ?
>
> Perhaps.
>
> > Does AFS allow remote access to devices a'la CIFS?
>
> No. :-)
>
I'm not sure I get why it's terribly useful to manipulate the cache on
a symlink or device file itself. There's generally not much cached
anyway, right (generally nothing more than a page anyway).
> > Could we allow posix_fadvise on O_PATH opens? For symlinks there is always
> > O_NOFOLLOW.
>
> Maybe. Al?
>
> This doesn't work for mounted-over mountpoints, however. I guess we could add
> AT_NO_FOLLOW_MOUNTS to get the basalmost mountpoint.
>
Yeah, perhaps.
--
Jeff Layton <jlayton@redhat.com>
next prev parent reply other threads:[~2017-01-20 18:14 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-17 16:42 ` David Howells
2017-01-20 16:53 ` [Lsf-pc] " Jeff Layton
2017-01-20 17:45 ` David Howells
2017-01-20 18:08 ` Jeff Layton [this message]
2017-01-15 23:36 ` Oleg Drokin
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=1484935685.2807.6.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 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.