netfs, ceph: Partially revert "netfs: Replace PG_fscache by setting folio->private and marking dirty"
Subsystems (4)
David Howells
maintainerPATCH 1/1 netfs, ceph: Partially revert "netfs: Replace PG_fscache by setting folio->private and marking dirty"
This partially reverts commit 2ff1e97587f4d398686f52c07afde3faf3da4e5c.
In addition to reverting the removal of PG_private_2 wrangling from the buffered read code[1][2], the removal of the waits for PG_private_2 from netfs_release_folio() and netfs_invalidate_folio() need reverting too.
It also adds a wait into ceph_evict_inode() to wait for netfs read and copy-to-cache ops to complete.
--- fs/ceph/inode.c | 1 + fs/netfs/misc.c | 7 +++++++ 2 files changed, 8 insertions(+)
fs/ceph/inode.c +1 -0
@@ -695,6 +695,7 @@ void ceph_evict_inode(struct inode *inode)percpu_counter_dec (&mdsc->metric.total_inodes); +netfs_wait_for_outstanding_io (inode);truncate_inode_pages_final (&inode->i_data);if (inode->i_state &I_PINNING_NETFS_WB )ceph_fscache_unuse_cookie (inode, true);
fs/netfs/misc.c +7 -0
@@ -101,6 +101,8 @@ void netfs_invalidate_folio(struct folio *folio, size_t offset, size_t length)_enter ("{%lx},%zx,%zx" , folio->index, offset, length); +folio_wait_private_2 (folio);/* [DEPRECATED] */ +if (!folio_test_private (folio))return ;
@@ -165,6 +167,11 @@ bool netfs_release_folio(struct folio *folio, gfp_t gfp)if (folio_test_private (folio))return false; +if (unlikely (folio_test_private_2 (folio))) {/* [DEPRECATED] */ +if (current_is_kswapd () || !(gfp & __GFP_FS)) +return false; +folio_wait_private_2 (folio); + }fscache_note_page_release (netfs_i_cookie (ctx));return true; }
Christian Brauner
maintainerQuoted 23 lines · David Howells
This partially reverts commit
2ff1e97587f4d398686f52c07afde3faf3da4e5c.In addition to reverting the removal of
PG_private_2wrangling from the buffered read code[1][2], the removal of the waits forPG_private_2fromnetfs_release_folio()andnetfs_invalidate_folio()need reverting too.It also adds a wait into
ceph_evict_inode()to wait for netfs read and copy-to-cache ops to complete.Fixes 2ff1e97587f4 ("netfs: Replace PG_fscache by setting folio->private and marking dirty")Signed-off-by David Howells <[email protected]>cc Max Kellermann <[email protected]>cc Ilya Dryomov <[email protected]>cc Xiubo Li <[email protected]>cc Jeff Layton <[email protected]>cc Matthew Wilcox <[email protected]>
Quoted 1 line
---
Now in vfs.fixes.
@Konstantin, for some reason I keep having issues with this patch series. It confuses b4 to no end. When I try to shazam this single patch here using [email protected] it pull down a 26 patch series. And with -P _ it complains that it can't find the messag id.
Quoted 5 lines · Christian Brauner
@Konstantin, for some reason I keep having issues with this patch series. It confuses b4 to no end. When I try to shazam this single patch here using [email protected] it pull down a 26 patch series. And with -P _ it complains that it can't find the messag id.
I cannot reproduce this, which suggests to me that there's something going on with cached data specific to your local content. Can you please run the following:
b4 -d shazam [email protected] > /tmp/b4-debug.out 2>&1
then gzip and send that to me?
-K
Quoted 55 lines · David Howells
This partially reverts commit
2ff1e97587f4d398686f52c07afde3faf3da4e5c.In addition to reverting the removal of
PG_private_2wrangling from the buffered read code[1][2], the removal of the waits forPG_private_2fromnetfs_release_folio()andnetfs_invalidate_folio()need reverting too.It also adds a wait into
ceph_evict_inode()to wait for netfs read and copy-to-cache ops to complete.Fixes 2ff1e97587f4 ("netfs: Replace PG_fscache by setting folio->private and marking dirty")Signed-off-by David Howells <[email protected]>cc Max Kellermann <[email protected]>cc Ilya Dryomov <[email protected]>cc Xiubo Li <[email protected]>cc Jeff Layton <[email protected]>cc Matthew Wilcox <[email protected]>--- fs/ceph/inode.c | 1 + fs/netfs/misc.c | 7 +++++++ 2 files changed, 8 insertions(+)fs/ceph/inode.c +1
-0@@ -695,6 +695,7 @@ void ceph_evict_inode(struct inode *inode)percpu_counter_dec (&mdsc->metric.total_inodes); +netfs_wait_for_outstanding_io (inode);truncate_inode_pages_final (&inode->i_data);if (inode->i_state &I_PINNING_NETFS_WB )ceph_fscache_unuse_cookie (inode, true);fs/netfs/misc.c +2
-0@@ -101,6 +101,8 @@ void netfs_invalidate_folio(struct folio *folio, size_t offset, size_t length)_enter ("{%lx},%zx,%zx" , folio->index, offset, length); +folio_wait_private_2 (folio);/* [DEPRECATED] */ +if (!folio_test_private (folio))return ;@@ -165,6 +167,11 @@ bool netfs_release_folio(struct folio *folio, gfp_t gfp)
fs/netfs/misc.c bool netfs_release_folio(struct folio *folio, gfp_t gfp) · line 177
Quoted 10 lines
fs/netfs/misc.c +5
-0if (folio_test_private (folio))return false; +if (unlikely (folio_test_private_2 (folio))) {/* [DEPRECATED] */ +if (current_is_kswapd () || !(gfp & __GFP_FS)) +return false; +folio_wait_private_2 (folio); + }fscache_note_page_release (netfs_i_cookie (ctx));return true; }
Just back from PTOs.
This LGTM and I will run the test today locally.
Thanks David.
- Xiubo
Quoted 56 lines · David Howells
This partially reverts commit
2ff1e97587f4d398686f52c07afde3faf3da4e5c.In addition to reverting the removal of
PG_private_2wrangling from the buffered read code[1][2], the removal of the waits forPG_private_2fromnetfs_release_folio()andnetfs_invalidate_folio()need reverting too.It also adds a wait into
ceph_evict_inode()to wait for netfs read and copy-to-cache ops to complete.Fixes 2ff1e97587f4 ("netfs: Replace PG_fscache by setting folio->private and marking dirty")Signed-off-by David Howells <[email protected]>cc Max Kellermann <[email protected]>cc Ilya Dryomov <[email protected]>cc Xiubo Li <[email protected]>cc Jeff Layton <[email protected]>cc Matthew Wilcox <[email protected]>--- fs/ceph/inode.c | 1 + fs/netfs/misc.c | 7 +++++++ 2 files changed, 8 insertions(+)fs/ceph/inode.c +1
-0@@ -695,6 +695,7 @@ void ceph_evict_inode(struct inode *inode)percpu_counter_dec (&mdsc->metric.total_inodes); +netfs_wait_for_outstanding_io (inode);truncate_inode_pages_final (&inode->i_data);if (inode->i_state &I_PINNING_NETFS_WB )ceph_fscache_unuse_cookie (inode, true);fs/netfs/misc.c +2
-0@@ -101,6 +101,8 @@ void netfs_invalidate_folio(struct folio *folio, size_t offset, size_t length)_enter ("{%lx},%zx,%zx" , folio->index, offset, length); +folio_wait_private_2 (folio);/* [DEPRECATED] */ +if (!folio_test_private (folio))return ;@@ -165,6 +167,11 @@ bool netfs_release_folio(struct folio *folio, gfp_t gfp)
fs/netfs/misc.c bool netfs_release_folio(struct folio *folio, gfp_t gfp) · line 177
Quoted 10 lines
fs/netfs/misc.c +5
-0if (folio_test_private (folio))return false; +if (unlikely (folio_test_private_2 (folio))) {/* [DEPRECATED] */ +if (current_is_kswapd () || !(gfp & __GFP_FS)) +return false; +folio_wait_private_2 (folio); + }fscache_note_page_release (netfs_i_cookie (ctx));return true; }
Tested it and worked fine.
Thanks