From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: David Howells <dhowells@redhat.com>
Cc: Jeff Layton <jlayton@kernel.org>,
Christian Brauner <brauner@kernel.org>,
Matthew Wilcox <willy@infradead.org>,
Eric Sandeen <esandeen@redhat.com>,
v9fs@lists.linux.dev, linux-afs@lists.infradead.org,
ceph-devel@vger.kernel.org, linux-cifs@vger.kernel.org,
samba-technical@lists.samba.org, linux-nfs@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Roadmap for netfslib and local caching (cachefiles)
Date: Thu, 25 Jan 2024 23:22:31 +0800 [thread overview]
Message-ID: <8ac3a2fd-1c41-493a-b6a0-a5f53afb49e1@linux.alibaba.com> (raw)
In-Reply-To: <520668.1706191347@warthog.procyon.org.uk>
Hi David,
On 2024/1/25 22:02, David Howells wrote:
> Here's a roadmap for the future development of netfslib and local caching
> (e.g. cachefiles).
Thanks for writing this detailed email. And congrats to you work.
I only comment the parts directly related to myself.
>
...
>
>
> Local Caching
> =============
>
> There are a number of things I want to look at with local caching:
>
> [>] Although cachefiles has switched from using bmap to using SEEK_HOLE and
> SEEK_DATA, this isn't sufficient as we cannot rely on the backing filesystem
> optimising things and introducing both false positives and false negatives.
> Cachefiles needs to track the presence/absence of data for itself.
Yes, that is indeed an issue that needs to resolve and already discussed
before.
>
> I had a partially-implemented solution that stores a block bitmap in an xattr,
> but that only worked up to files of 1G in size (with bits representing 256K
> blocks in a 512-byte bitmap).
Jingbo once had an approach to use external bitmap files and
extended-attribute pointers inside the cache files:
https://listman.redhat.com/archives/linux-cachefs/2022-August/007050.html
I'm not quite sure the performance was but if it's worth trying or comparing,
that might be useful though.
>
> [>] An alternative cache format might prove more fruitful. Various AFS
> implementations use a 'tagged cache' format with an index file and a bunch of
> small files each of which contains a single block (typically 256K in OpenAFS).
>
> This would offer some advantages over the current approach:
>
> - it can handle entry reuse within the index
> - doesn't require an external culling process
> - doesn't need to truncate/reallocate when invalidating
>
> There are some downsides, including:
>
> - each block is in a separate file
Not quite sure, yet accessing too many small files might be another issue
which is currently happening with AI training workloads.. but as you said,
it's worth trying.
> - metadata coherency is more tricky - a powercut may require a cache wipe
> - the index key is highly variable in size if used for multiple filesystems
>
> But OpenAFS has been using this for something like 30 years, so it's probably
> worth a try.
Yes, also configurable chunk sizes per blob are much helpful.
Thanks,
Gao Xiang
>
> [>] Need to work out some way to store xattrs, directory entries and inode
> metadata efficiently.
>
> [>] Using NVRAM as the cache rather than spinning rust.
>
> [>] Support for disconnected operation to pin desirable data and keep
> track of changes.
>
> [>] A user API by which the cache for specific files or volumes can be
> flushed.
>
>
> Disconnected Operation
> ======================
>
> I'm working towards providing support for disconnected operation, so that,
> provided you've got your working set pinned in the cache, you can continue to
> work on your network-provided files when the network goes away and resync the
> changes later.
>
> This is going to require a number of things:
>
> (1) A user API by which files can be preloaded into the cache and pinned.
>
> (2) The ability to track changes in the cache.
>
> (3) A way to synchronise changes on reconnection.
>
> (4) A way to communicate to the user when there's a conflict with a third
> party change on reconnect. This might involve communicating via systemd
> to the desktop environment to ask the user to indicate how they'd like
> conflicts recolved.
>
> (5) A way to prompt the user to re-enter their authentication/crypto keys.
>
> (6) A way to ask the user how to handle a process that wants to access data
> we don't have (error/wait) - and how to handle the DE getting stuck in
> this fashion.
>
> David
next prev parent reply other threads:[~2024-01-25 15:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-25 14:02 Roadmap for netfslib and local caching (cachefiles) David Howells
2024-01-25 14:11 ` Benjamin Coddington
2024-01-25 15:07 ` David Howells
2024-01-25 19:28 ` Benjamin Coddington
2024-01-25 15:22 ` Gao Xiang [this message]
2024-01-25 16:29 ` Jeff Layton
2024-01-25 17:23 ` Christian Brauner
2024-02-06 8:39 ` David Howells
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=8ac3a2fd-1c41-493a-b6a0-a5f53afb49e1@linux.alibaba.com \
--to=hsiangkao@linux.alibaba.com \
--cc=brauner@kernel.org \
--cc=ceph-devel@vger.kernel.org \
--cc=dhowells@redhat.com \
--cc=esandeen@redhat.com \
--cc=jlayton@kernel.org \
--cc=linux-afs@lists.infradead.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=samba-technical@lists.samba.org \
--cc=v9fs@lists.linux.dev \
--cc=willy@infradead.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