[Linux-cachefs] Re: [PATCH] [Request for inclusion] Filesystem in Userspace
Miklos Szeredi
miklos at szeredi.hu
Sat Nov 27 12:59:31 UTC 2004
> Check fscache (or cachefs), right now it has the 'problem' that it
> considers all cached pages as purgeable, but David Howell's did express
> some interest in adding the ability to pin pages until the fs has
> written back the data or at least he will probably consider accepting
> patches to that extent.
OK. It's not clear to me who is the 'owner' of a page. Is it the
page cache or cachefs? So what exectly happens when I update a page
in fscache? Is it copied to an cachefs page and then later written
back to disk, or is it immediately sent to disk?
> Effectively both clean and dirty pages would get backed on disk by
> fscache, this might be advantageous especially if FUSE has to pull the
> data off of some slow medium or from the network.
That sounds good, though I think it would be better if caching could
be made optional. Many userspace filesystems are not network
filesystems, and often recreating the data is cheaper than reading
back from a disk cache.
> If the dirty pages can
> get pinned, then a write would work as follows,
>
> writepage
> update (and pin) page in the fscache
> queue (async) write request to userspace
>
> Now as far as the kernel is concerned once writepage returns the page is
> clean and can be dropped. Userspace can then use a downcall to pull the
> page out of the fscache and unpin it. I don't know if fscache/cachefs
> has a filesystem like interface which would allow access to the page
> directly with open/seek/read operations without going back through the
> FUSE kernel module.
It sounds to me cleaner if cached data is always accessed through
FUSE, so I don't think such an interface is neccessary, nor that it
would improve performance.
Thanks,
Miklos
More information about the Linux-cachefs
mailing list