Re: [Cluster-devel] [PATCH v3 00/14] gfs2/buffer folio changes for 6.5

2023-06-12 Thread Andreas Gruenbacher
On Mon, Jun 12, 2023 at 11:02 PM Matthew Wilcox (Oracle) wrote: > This kind of started off as a gfs2 patch series, then became entwined > with buffer heads once I realised that gfs2 was the only remaining > caller of __block_write_full_page(). For those not in the gfs2 world, > the big point of

[Cluster-devel] [PATCH v3 04/14] buffer: Convert __block_write_full_page() to __block_write_full_folio()

2023-06-12 Thread Matthew Wilcox (Oracle)
Remove nine hidden calls to compound_head() by using a folio instead of a page. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Bob Peterson Reviewed-by: Bob Peterson --- fs/buffer.c | 53 +++-- fs/gfs2/aops.c | 5 ++--

[Cluster-devel] [PATCH v3 05/14] gfs2: Support ludicrously large folios in gfs2_trans_add_databufs()

2023-06-12 Thread Matthew Wilcox (Oracle)
We may someday support folios larger than 4GB, so use a size_t for the byte count within a folio to prevent unpleasant truncations. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Bob Peterson Reviewed-by: Bob Peterson --- fs/gfs2/aops.c | 6 +++--- fs/gfs2/aops.h | 2 +- 2 files changed, 4

[Cluster-devel] [PATCH v3 08/14] buffer: Convert __block_commit_write() to take a folio

2023-06-12 Thread Matthew Wilcox (Oracle)
This removes a hidden call to compound_head() inside __block_commit_write() and moves it to those callers which are still page based. Also make block_write_end() safe for large folios. Signed-off-by: Matthew Wilcox (Oracle) --- fs/buffer.c | 38 +++--- 1 file

[Cluster-devel] [PATCH v3 00/14] gfs2/buffer folio changes for 6.5

2023-06-12 Thread Matthew Wilcox (Oracle)
This kind of started off as a gfs2 patch series, then became entwined with buffer heads once I realised that gfs2 was the only remaining caller of __block_write_full_page(). For those not in the gfs2 world, the big point of this series is that block_write_full_page() should now handle large

[Cluster-devel] [PATCH v3 01/14] gfs2: Use a folio inside gfs2_jdata_writepage()

2023-06-12 Thread Matthew Wilcox (Oracle)
Replace a few implicit calls to compound_head() with one explicit one. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Bob Peterson Reviewed-by: Bob Peterson --- fs/gfs2/aops.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index

[Cluster-devel] [PATCH v3 02/14] gfs2: Pass a folio to __gfs2_jdata_write_folio()

2023-06-12 Thread Matthew Wilcox (Oracle)
Remove a couple of folio->page conversions in the callers, and two calls to compound_head() in the function itself. Rename it from __gfs2_jdata_writepage() to __gfs2_jdata_write_folio(). Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Bob Peterson Reviewed-by: Bob Peterson ---

[Cluster-devel] [PATCH v3 07/14] buffer: Convert block_page_mkwrite() to use a folio

2023-06-12 Thread Matthew Wilcox (Oracle)
If any page in a folio is dirtied, dirty the entire folio. Removes a number of hidden calls to compound_head() and references to page->mapping and page->index. Fixes a pre-existing bug where we could mark a folio as dirty if the file is truncated to a multiple of the page size just as we take

[Cluster-devel] [PATCH v3 06/14] buffer: Make block_write_full_page() handle large folios correctly

2023-06-12 Thread Matthew Wilcox (Oracle)
Keep the interface as struct page, but work entirely on the folio internally. Removes several PAGE_SIZE assumptions and removes some references to page->index and page->mapping. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Bob Peterson Reviewed-by: Bob Peterson --- fs/buffer.c | 22

[Cluster-devel] [PATCH v3 13/14] buffer: Use a folio in __find_get_block_slow()

2023-06-12 Thread Matthew Wilcox (Oracle)
Saves a call to compound_head() and may be needed to support block size > PAGE_SIZE. Signed-off-by: Matthew Wilcox (Oracle) --- fs/buffer.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 4ca2eb2b3dca..c38fdcaa32ff 100644 ---

[Cluster-devel] [PATCH v3 03/14] gfs2: Convert gfs2_write_jdata_page() to gfs2_write_jdata_folio()

2023-06-12 Thread Matthew Wilcox (Oracle)
Add support for large folios and remove some accesses to page->mapping and page->index. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Bob Peterson Reviewed-by: Bob Peterson --- fs/gfs2/aops.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git

[Cluster-devel] [PATCH v3 09/14] buffer: Convert page_zero_new_buffers() to folio_zero_new_buffers()

2023-06-12 Thread Matthew Wilcox (Oracle)
Most of the callers already have a folio; convert reiserfs_write_end() to have a folio. Removes a couple of hidden calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/buffer.c | 27 ++- fs/ext4/inode.c | 4 ++--

[Cluster-devel] [PATCH v3 11/14] buffer: Convert init_page_buffers() to folio_init_buffers()

2023-06-12 Thread Matthew Wilcox (Oracle)
Use the folio API and pass the folio from both callers. Saves a hidden call to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/buffer.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index

[Cluster-devel] [PATCH v3 14/14] buffer: Convert block_truncate_page() to use a folio

2023-06-12 Thread Matthew Wilcox (Oracle)
Support large folios in block_truncate_page() and avoid three hidden calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/buffer.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index

[Cluster-devel] [PATCH v3 12/14] buffer: Convert link_dev_buffers to take a folio

2023-06-12 Thread Matthew Wilcox (Oracle)
Its one caller already has a folio, so switch it to use the folio API. Removes a hidden call to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/buffer.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index

[Cluster-devel] [PATCH v3 10/14] buffer: Convert grow_dev_page() to use a folio

2023-06-12 Thread Matthew Wilcox (Oracle)
Get a folio from the page cache instead of a page, then use the folio API throughout. Removes a few calls to compound_head() and may be needed to support block size > PAGE_SIZE. Signed-off-by: Matthew Wilcox (Oracle) --- fs/buffer.c | 34 +++--- 1 file changed, 15

[Cluster-devel] [PATCH] gfs2: Fix duplicate should_fault_in_pages() call

2023-06-12 Thread Andreas Gruenbacher
From: Bob Peterson In gfs2_file_buffered_write(), we currently jump from the second call of function should_fault_in_pages() to above the first call, so should_fault_in_pages() is getting called twice in a row, causing it to accidentally fall back to single-page writes rather than trying the

[Cluster-devel] [PATCH 8/8] gfs2: gfs2_freeze_lock_shared cleanup

2023-06-12 Thread Andreas Gruenbacher
All the remaining users of gfs2_freeze_lock_shared() set freeze_gh to >sd_freeze_gh and flags to 0, so remove those two parameters. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/ops_fstype.c | 2 +- fs/gfs2/super.c | 4 ++-- fs/gfs2/util.c | 9 +++-- fs/gfs2/util.h | 4

[Cluster-devel] [PATCH 6/8] gfs2: Rework freeze / thaw logic

2023-06-12 Thread Andreas Gruenbacher
So far, at mount time, gfs2 would take the freeze glock in shared mode and then immediately drop it again, turning it into a cached glock that can be reclaimed at any time. To freeze the filesystem cluster-wide, the node initiating the freeze would take the freeze glock in exclusive mode, which

[Cluster-devel] [PATCH 7/8] gfs2: Replace sd_freeze_state with SDF_FROZEN flag

2023-06-12 Thread Andreas Gruenbacher
Replace sd_freeze_state with a new SDF_FROZEN flag. There no longer is a need for indicating that a freeze is in progress (SDF_STARTING_FREEZE); we are now protecting the critical sections with the sd_freeze_mutex. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/incore.h | 8 +---

[Cluster-devel] [PATCH 5/8] gfs2: Rename SDF_{FS_FROZEN => FREEZE_INITIATOR}

2023-06-12 Thread Andreas Gruenbacher
Rename the SDF_FS_FROZEN flag to SDF_FREEZE_INITIATOR to indicate more clearly that the node that has this flag set is the initiator of the freeze. Signed-off-by: Andreas Gruenbacher sd_flags); - wake_up_bit(>sd_flags, SDF_FS_FROZEN); + clear_bit_unlock(SDF_FREEZE_INITIATOR,

[Cluster-devel] [PATCH 4/8] gfs2: Reconfiguring frozen filesystem already rejected

2023-06-12 Thread Andreas Gruenbacher
Reconfiguring a frozen filesystem is already rejected in reconfigure_super(), so there is no need to check for that condition again at the filesystem level. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/ops_fstype.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/fs/gfs2/ops_fstype.c

[Cluster-devel] [PATCH 3/8] gfs2: Rename gfs2_freeze_lock{ => _shared }

2023-06-12 Thread Andreas Gruenbacher
Rename gfs2_freeze_lock to gfs2_freeze_lock_shared to make it a bit more obvious that this function establishes the "thawed" state of the freeze glock. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/ops_fstype.c | 4 ++-- fs/gfs2/recovery.c | 2 +- fs/gfs2/super.c | 2 +-

[Cluster-devel] [PATCH 2/8] gfs2: Rename the {freeze, thaw}_super callbacks

2023-06-12 Thread Andreas Gruenbacher
Rename gfs2_freeze to gfs2_freeze_super and gfs2_unfreeze to gfs2_thaw_super to match the names of the corresponding super operations. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/super.c | 12 ++-- fs/gfs2/util.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git

[Cluster-devel] [PATCH 1/8] gfs2: Rename remaining "transaction" glock references

2023-06-12 Thread Andreas Gruenbacher
The transaction glock was repurposed to serve as the new freeze glock years ago. Don't refer to it as the transaction glock anymore. Also, to be more precise, call it the "freeze glock" instead of the "freeze lock". Ditto for the journal glock. Signed-off-by: Andreas Gruenbacher ---

[Cluster-devel] [PATCH 0/8] gfs2: Rework freeze / thaw logic

2023-06-12 Thread Andreas Gruenbacher
Currently, filesystem freeze is implemented inside freeze_go_sync(), a glock state transition callback. It turns out that in some scenarios, freezing the filesystem in such a callback can deadlock. To prevent that from happening, rework the freeze / thaw logic and move it out of the glock state

Re: [Cluster-devel] [PATCH] gfs2: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method

2023-06-12 Thread Andreas Gruenbacher
On Mon, Jun 12, 2023 at 7:54 AM Christoph Hellwig wrote: > Since commit a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag") file > systems can just set the FMODE_CAN_ODIRECT flag at open time instead of > wiring up a dummy direct_IO method to indicate support for direct I/O. > > Remove

Re: [Cluster-devel] [linux-next:master] [splice] 2cb1e08985: stress-ng.sendfile.ops_per_sec 11.6% improvement

2023-06-12 Thread David Howells
kernel test robot wrote: > kernel test robot noticed a 11.6% improvement of > stress-ng.sendfile.ops_per_sec on: If it's sending to a socket, this is entirely feasible. The splice_to_socket() function now sends multiple pages in one go to the network protocol's sendmsg() method to process

Re: [Cluster-devel] [PATCH 7/9] gfs2: update ctime when quota is updated

2023-06-12 Thread Jeff Layton
On Fri, 2023-06-09 at 18:44 +0200, Andreas Gruenbacher wrote: > Jeff, > > On Fri, Jun 9, 2023 at 2:50 PM Jeff Layton wrote: > > Signed-off-by: Jeff Layton > > --- > > fs/gfs2/quota.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/fs/gfs2/quota.c