2021-01-22 18:11:17

by Jeff Layton

[permalink] [raw]
Subject: [RFC PATCH 0/6] ceph: convert buffered read codepaths to new netfs API

This patchset coverts ceph to use the new netfs API that David Howells
has proposed [1]. It's a substantial reduction in code in the ceph layer
itself, but the main impetus is to allow the VM, filesystem and fscache
to better work together to optimize readahead on network filesystems.

I think the resulting code is also easier to understand, and should be
more maintainable as a lot of the pagecache handling is now done at the
netfs layer.

This has been lightly tested with xfstests. With fscache disabled, I saw
no regressions. With fscache enabled, I still hit some bugs down in the
fscache layer itself, but those seem to be present without this set as
well. This doesn't seem to make any of that worse.

[1]: https://lore.kernel.org/ceph-devel/[email protected]/T/#t

Jeff Layton (6):
ceph: disable old fscache readpage handling
ceph: rework PageFsCache handling
ceph: fix invalidation
ceph: convert readpage to fscache read helper
ceph: plug write_begin into read helper
ceph: convert ceph_readpages to ceph_readahead

fs/ceph/Kconfig | 1 +
fs/ceph/addr.c | 536 +++++++++++++++++++-----------------------------
fs/ceph/cache.c | 123 -----------
fs/ceph/cache.h | 101 +++------
fs/ceph/caps.c | 10 +-
fs/ceph/inode.c | 1 +
6 files changed, 236 insertions(+), 536 deletions(-)

--
2.29.2


2021-01-22 18:12:10

by Jeff Layton

[permalink] [raw]
Subject: [RFC PATCH 3/6] ceph: fix invalidation

Ensure that we invalidate the fscache whenever we go to invalidate the
pagecache.

Signed-off-by: Jeff Layton <[email protected]>
---
fs/ceph/caps.c | 1 +
fs/ceph/inode.c | 1 +
2 files changed, 2 insertions(+)

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 21ba949ca2c3..0102221db7bf 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -1867,6 +1867,7 @@ static int try_nonblocking_invalidate(struct inode *inode)
u32 invalidating_gen = ci->i_rdcache_gen;

spin_unlock(&ci->i_ceph_lock);
+ ceph_fscache_invalidate(inode);
invalidate_mapping_pages(&inode->i_data, 0, -1);
spin_lock(&ci->i_ceph_lock);

diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 5d20a620e96c..2d424b41a8b9 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1863,6 +1863,7 @@ static void ceph_do_invalidate_pages(struct inode *inode)
orig_gen = ci->i_rdcache_gen;
spin_unlock(&ci->i_ceph_lock);

+ ceph_fscache_invalidate(inode);
if (invalidate_inode_pages2(inode->i_mapping) < 0) {
pr_err("invalidate_pages %p fails\n", inode);
}
--
2.29.2