Re: [Cluster-devel] [PATCH 02/11] xfs: add NOWAIT semantics for readdir

2023-08-29 Thread Matthew Wilcox
On Tue, Aug 29, 2023 at 03:41:43PM +0800, Hao Xu wrote: > On 8/28/23 04:44, Matthew Wilcox wrote: > > > @@ -391,10 +401,17 @@ xfs_dir2_leaf_getdents( > > > bp = NULL; > > > } > > >

Re: [Cluster-devel] [PATCH 07/11] vfs: add nowait parameter for file_accessed()

2023-08-29 Thread Matthew Wilcox
On Tue, Aug 29, 2023 at 03:46:13PM +0800, Hao Xu wrote: > On 8/28/23 05:32, Matthew Wilcox wrote: > > On Sun, Aug 27, 2023 at 09:28:31PM +0800, Hao Xu wrote: > > > From: Hao Xu > > > > > > Add a boolean parameter for file_accessed() to support nowait semant

Re: [Cluster-devel] [PATCH 07/11] vfs: add nowait parameter for file_accessed()

2023-08-27 Thread Matthew Wilcox
On Sun, Aug 27, 2023 at 09:28:31PM +0800, Hao Xu wrote: > From: Hao Xu > > Add a boolean parameter for file_accessed() to support nowait semantics. > Currently it is true only with io_uring as its initial caller. So why do we need to do this as part of this series? Apparently it hasn't caused

Re: [Cluster-devel] [PATCH 09/11] vfs: error out -EAGAIN if atime needs to be updated

2023-08-27 Thread Matthew Wilcox
On Sun, Aug 27, 2023 at 09:28:33PM +0800, Hao Xu wrote: > From: Hao Xu > > To enforce nowait semantics, error out -EAGAIN if atime needs to be > updated. Squash this into patch 6. Otherwise patch 6 makes no sense.

Re: [Cluster-devel] [PATCH 04/11] vfs: add a vfs helper for io_uring file pos lock

2023-08-27 Thread Matthew Wilcox
On Sun, Aug 27, 2023 at 09:28:28PM +0800, Hao Xu wrote: > +++ b/include/linux/file.h > @@ -81,6 +81,8 @@ static inline void fdput_pos(struct fd f) > fdput(f); > } > > +extern int file_pos_lock_nowait(struct file *file, bool nowait); No extern on function declarations.

Re: [Cluster-devel] [PATCH 02/11] xfs: add NOWAIT semantics for readdir

2023-08-27 Thread Matthew Wilcox
On Sun, Aug 27, 2023 at 09:28:26PM +0800, Hao Xu wrote: > +++ b/fs/xfs/libxfs/xfs_da_btree.c > @@ -2643,16 +2643,32 @@ xfs_da_read_buf( > struct xfs_buf_map map, *mapp = > int nmap = 1; > int error; > + int

Re: [Cluster-devel] [PATCH 22/29] xfs: comment page allocation for nowait case in xfs_buf_find_insert()

2023-08-25 Thread Matthew Wilcox
On Fri, Aug 25, 2023 at 09:54:24PM +0800, Hao Xu wrote: > @@ -633,6 +633,8 @@ xfs_buf_find_insert( >* allocate the memory from the heap to minimise memory usage. If we >* can't get heap memory for these small buffers, we fall back to using >* the page allocator. > + *

Re: [Cluster-devel] [PATCH 12/29] xfs: enforce GFP_NOIO implicitly during nowait time update

2023-08-25 Thread Matthew Wilcox
On Fri, Aug 25, 2023 at 09:54:14PM +0800, Hao Xu wrote: > +++ b/fs/xfs/xfs_iops.c > @@ -1037,6 +1037,8 @@ xfs_vn_update_time( > int log_flags = XFS_ILOG_TIMESTAMP; > struct xfs_trans*tp; > int error; > + int

Re: [Cluster-devel] gfs2 write bandwidth regression on 6.4-rc3 compareto 5.15.y

2023-07-10 Thread Matthew Wilcox
On Mon, Jul 10, 2023 at 03:19:54PM +0200, Andreas Gruenbacher wrote: > Hi Wang Yugui, > > On Sun, May 28, 2023 at 5:53 PM Wang Yugui wrote: > > Hi, > > > > > Hi, > > > > > > gfs2 write bandwidth regression on 6.4-rc3 compare to 5.15.y. > > > > > > we added linux-xfs@ and linux-fsdevel@ because

[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 ++-- fs/ntfs

[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)
folios correctly. Andrew, if you want, I'll drop it into the pagecache tree, or you can just take it. v3: - Fix a patch title - Fix some checks against i_size to be >= instead of > - Call folio_mark_dirty() instead of folio_set_dirty() Matthew Wilcox (Oracle) (14): gfs2: Use a folio

[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 --- fs/g

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

2023-06-12 Thread Matthew Wilcox (Oracle)
e take the page fault. I don't believe this bug has any bad effect, it's just inefficient. Signed-off-by: Matthew Wilcox (Oracle) --- fs/buffer.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 34ecf55d2f12..0af167

[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.

[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 --- a

[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

[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 ++-- fs

[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 06d031e28bee

[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 c38fdcaa32ff

[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 9b9dee417467

[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,

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

2023-06-06 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.

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

2023-06-06 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 v2 05/14] gfs2: Support ludicrously large folios in gfs2_trans_add_databufs()

2023-06-06 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 v2 04/14] buffer: Convert __block_write_full_page() to __block_write_full_folio()

2023-06-06 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 ++-- fs/ntfs

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

2023-06-06 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 --- fs/g

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

2023-06-06 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 ++-- fs

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

2023-06-06 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. Signed-off-by: Matthew Wilcox (Oracle) --- fs/buffer.c | 27 +-- 1 file changed, 13 insertions(

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

2023-06-06 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

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

2023-06-06 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 v2 13/14] buffer: Use a folio in __find_get_block_slow()

2023-06-06 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 c81b8b20ad64..9f761a201e32 100644 --- a

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

2023-06-06 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,

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

2023-06-06 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 c4fc4b3b8aab

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

2023-06-06 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 9b789f109a57

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

2023-06-06 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 9f761a201e32

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

2023-06-06 Thread Matthew Wilcox (Oracle)
folios correctly. Andrew, if you want, I'll drop it into the pagecache tree, or you can just take it. Matthew Wilcox (Oracle) (14): gfs2: Use a folio inside gfs2_jdata_writepage() gfs2: Pass a folio to __gfs2_jdata_write_folio() gfs2: Convert gfs2_write_jdata_page() to gfs2_write_jdata_folio

Re: [Cluster-devel] [PATCH 3/6] gfs2: Convert gfs2_write_jdata_page() to gfs2_write_jdata_folio()

2023-06-03 Thread Matthew Wilcox
On Sat, Jun 03, 2023 at 11:34:14AM +0200, Andreas Gruenbacher wrote: > > * This is the same as calling block_write_full_page, but it also > > * writes pages outside of i_size > > */ > > -static int gfs2_write_jdata_page(struct page *page, > > +static int gfs2_write_jdata_folio(struct folio

Re: [Cluster-devel] [PATCH v6 20/20] block: mark bio_add_folio as __must_check

2023-05-30 Thread Matthew Wilcox
On Tue, May 30, 2023 at 08:49:23AM -0700, Johannes Thumshirn wrote: > Now that all callers of bio_add_folio() check the return value, mark it as > __must_check. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Matthew Wilcox (Oracle)

Re: [Cluster-devel] [PATCH v6 19/20] fs: iomap: use __bio_add_folio where possible

2023-05-30 Thread Matthew Wilcox
a newly created bio can't fail, use the newly > introduced __bio_add_folio() function. > > Signed-off-by: Johannes Thumshirn Reviewed-by: Matthew Wilcox (Oracle)

Re: [Cluster-devel] [PATCH v6 18/20] block: add __bio_add_folio

2023-05-30 Thread Matthew Wilcox
On Tue, May 30, 2023 at 08:49:21AM -0700, Johannes Thumshirn wrote: > Just like for bio_add_pages() add a no-fail variant for bio_add_folio(). > > Signed-off-by: Johannes Thumshirn Reviewed-by: Matthew Wilcox (Oracle)

Re: [Cluster-devel] [PATCH 16/17] block: use iomap for writes to block devices

2023-05-24 Thread Matthew Wilcox
On Wed, May 24, 2023 at 08:27:13AM +1000, Dave Chinner wrote: > On Fri, May 19, 2023 at 04:22:01PM +0200, Hannes Reinecke wrote: > > I'm hitting this during booting: > > [5.016324] > > [5.030256] iomap_iter+0x11a/0x350 > > [5.030264] iomap_readahead+0x1eb/0x2c0 > > [5.030272]

Re: [Cluster-devel] [PATCH 5/6] gfs2: Support ludicrously large folios in gfs2_trans_add_databufs()

2023-05-23 Thread Matthew Wilcox
On Tue, May 23, 2023 at 02:46:07PM +0200, Andreas Gruenbacher wrote: > > void gfs2_trans_add_databufs(struct gfs2_inode *ip, struct folio *folio, > > -unsigned int from, unsigned int len) > > +size_t from, size_t len) > > { > >

Re: [Cluster-devel] [PATCH 08/13] iomap: assign current->backing_dev_info in iomap_file_buffered_write

2023-05-22 Thread Matthew Wilcox
On Mon, May 22, 2023 at 06:06:27PM -0700, Darrick J. Wong wrote: > On Fri, May 19, 2023 at 11:35:16AM +0200, Christoph Hellwig wrote: > > Move the assignment to current->backing_dev_info from the callers into > > iomap_file_buffered_write to reduce boiler plate code and reduce the > > scope to

Re: [Cluster-devel] [PATCH 4/6] buffer: Convert __block_write_full_page() to __block_write_full_folio()

2023-05-17 Thread Matthew Wilcox
On Wed, May 17, 2023 at 04:47:01PM +0200, Pankaj Raghav wrote: > > @@ -1793,7 +1793,7 @@ int __block_write_full_page(struct inode *inode, > > struct page *page, > > blocksize = bh->b_size; > > bbits = block_size_bits(blocksize); > > > > - block = (sector_t)page->index << (PAGE_SHIFT -

[Cluster-devel] [PATCH 4/6] buffer: Convert __block_write_full_page() to __block_write_full_folio()

2023-05-16 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) --- fs/buffer.c | 53 +++-- fs/gfs2/aops.c | 5 ++-- fs/ntfs/aops.c | 2 +- fs/reiserfs/inode.c

[Cluster-devel] [PATCH 1/6] gfs2: Use a folio inside gfs2_jdata_writepage()

2023-05-16 Thread Matthew Wilcox (Oracle)
Replace a few implicit calls to compound_head() with one explicit one. Signed-off-by: Matthew Wilcox (Oracle) --- 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 a5f4be6b9213..0518861df783 100644 --- a/fs/gfs2

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

2023-05-16 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) --- fs/buffer.c | 22 ++ 1 file changed, 10 inse

[Cluster-devel] [PATCH 0/6] gfs2/buffer folio changes

2023-05-16 Thread Matthew Wilcox (Oracle)
folios correctly. It probably makes most sense to take this through Andrew's tree, once enough people have signed off on it? Matthew Wilcox (Oracle) (6): gfs2: Use a folio inside gfs2_jdata_writepage() gfs2: Pass a folio to __gfs2_jdata_write_folio() gfs2: Convert gfs2_write_jdata_page

[Cluster-devel] [PATCH 2/6] gfs2: Pass a folio to __gfs2_jdata_write_folio()

2023-05-16 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) --- fs/gfs2/aops.c | 31 --- 1 f

[Cluster-devel] [PATCH 3/6] gfs2: Convert gfs2_write_jdata_page() to gfs2_write_jdata_folio()

2023-05-16 Thread Matthew Wilcox (Oracle)
This function now supports large folios, even if nothing around it does. Signed-off-by: Matthew Wilcox (Oracle) --- fs/gfs2/aops.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 749135252d52..0f92e3e117da

[Cluster-devel] [PATCH 5/6] gfs2: Support ludicrously large folios in gfs2_trans_add_databufs()

2023-05-16 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) --- fs/gfs2/aops.c | 2 +- fs/gfs2/aops.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/gfs2

Re: [Cluster-devel] [PATCH 17/17] fs: add CONFIG_BUFFER_HEAD

2023-05-01 Thread Matthew Wilcox
On Sun, Apr 30, 2023 at 08:14:03PM -0700, Luis Chamberlain wrote: > On Sat, Apr 29, 2023 at 02:20:17AM +0100, Matthew Wilcox wrote: > > > [ 11.322212] Call Trace: > > > [ 11.323224] > > > [ 11.324146] iomap_readpage_iter+0x96/0x300 > > > [

Re: [Cluster-devel] [PATCH 17/17] fs: add CONFIG_BUFFER_HEAD

2023-04-28 Thread Matthew Wilcox
On Fri, Apr 28, 2023 at 05:11:57PM -0700, Luis Chamberlain wrote: > [ 11.245248] BUG: kernel NULL pointer dereference, address: > [ 11.254581] #PF: supervisor read access in kernel mode > [ 11.257387] #PF: error_code(0x) - not-present page > [ 11.260921] PGD 0 P4D 0 >

Re: [Cluster-devel] [PATCH 03/17] fs: rename and move block_page_mkwrite_return

2023-04-24 Thread Matthew Wilcox
On Mon, Apr 24, 2023 at 07:49:12AM +0200, Christoph Hellwig wrote: > block_page_mkwrite_return is neither block nor mkwrite specific, and > should not be under CONFIG_BLOCK. Move it to mm.h and rename it to > errno_to_vmfault. Could you move it about 300 lines down and put it near vmf_error() so

Re: [Cluster-devel] [PATCH v3 19/19] block: mark bio_add_page as __must_check

2023-04-19 Thread Matthew Wilcox
On Wed, Apr 19, 2023 at 04:09:29PM +0200, Johannes Thumshirn wrote: > Now that all users of bio_add_page check for the return value, mark > bio_add_page as __must_check. Should probably add __must_check to bio_add_folio too? If this is really the way you want to go ... means we also need a

Re: [Cluster-devel] [PATCH 02/19] drbd: use __bio_add_page to add page to bio

2023-03-29 Thread Matthew Wilcox
On Wed, Mar 29, 2023 at 10:05:48AM -0700, Johannes Thumshirn wrote: > +++ b/drivers/block/drbd/drbd_bitmap.c > @@ -1043,9 +1043,11 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx > *ctx, int page_nr) __must_ho > bio = bio_alloc_bioset(device->ldev->md_bdev, 1, op, GFP_NOIO, >

Re: [Cluster-devel] [RFC v6 05/10] iomap/gfs2: Get page in page_prepare handler

2023-01-31 Thread Matthew Wilcox
On Sun, Jan 08, 2023 at 08:40:29PM +0100, Andreas Gruenbacher wrote: > +static struct folio * > +gfs2_iomap_page_prepare(struct iomap_iter *iter, loff_t pos, unsigned len) > { > + struct inode *inode = iter->inode; > unsigned int blockmask = i_blocksize(inode) - 1; > struct

Re: [Cluster-devel] [PATCH 8/9] btrfs: handle a NULL folio in extent_range_redirty_for_io

2023-01-18 Thread Matthew Wilcox
On Wed, Jan 18, 2023 at 10:43:28AM +0100, Christoph Hellwig wrote: > filemap_get_folio can return NULL, skip those cases. Hmm, I'm not sure that's true. We have one place that calls extent_range_redirty_for_io(), and it previously calls extent_range_clear_dirty_for_io() which has an explicit

Re: [Cluster-devel] [PATCH 7/9] gfs2: handle a NULL folio in gfs2_jhead_process_page

2023-01-18 Thread Matthew Wilcox
On Wed, Jan 18, 2023 at 10:43:27AM +0100, Christoph Hellwig wrote: > filemap_get_folio can return NULL, so exit early for that case. I'm not sure it can return NULL in this specific case. As I understand this code, we're scanning the journal looking for the log head. We've just submitted the

Re: [Cluster-devel] [PATCH 3/9] mm: use filemap_get_entry in filemap_get_incore_folio

2023-01-18 Thread Matthew Wilcox
> Signed-off-by: Christoph Hellwig Reviewed-by: Matthew Wilcox (Oracle)

Re: [Cluster-devel] [PATCH 2/9] mm: make mapping_get_entry available outside of filemap.c

2023-01-18 Thread Matthew Wilcox
On Wed, Jan 18, 2023 at 10:43:22AM +0100, Christoph Hellwig wrote: > mapping_get_entry is useful for page cache API users that need to know > about xa_value internals. Rename it and make it available in pagemap.h. > > Signed-off-by: Christoph Hellwig Reviewed-by: Matthew Wilcox (Oracle)

Re: [Cluster-devel] [PATCH 1/9] mm: don't look at xarray value entries in split_huge_pages_in_file

2023-01-18 Thread Matthew Wilcox
On Wed, Jan 18, 2023 at 10:43:21AM +0100, Christoph Hellwig wrote: > split_huge_pages_in_file never wants to do anything with the special > value enties. Switch to using filemap_get_folio to not even see them. > > Signed-off-by: Christoph Hellwig Reviewed-by: Matthew Wilcox (Oracle)

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-16 Thread Matthew Wilcox
On Sun, Jan 15, 2023 at 11:34:26PM -0800, Christoph Hellwig wrote: > We could do that. But while reading what Darrick wrote I came up with > another idea I quite like. Just split the FGP_ENTRY handling into > a separate helper. The logic and use cases are quite different from > the normal page

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-15 Thread Matthew Wilcox
On Sun, Jan 15, 2023 at 09:06:50AM -0800, Darrick J. Wong wrote: > On Sun, Jan 15, 2023 at 09:01:22AM -0800, Darrick J. Wong wrote: > > On Tue, Jan 10, 2023 at 01:34:16PM +, Matthew Wilcox wrote: > > > On Tue, Jan 10, 2023 at 12:46:45AM -0800, Christoph Hellwig wrote: >

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-11 Thread Matthew Wilcox
On Tue, Jan 10, 2023 at 07:24:27AM -0800, Christoph Hellwig wrote: > On Tue, Jan 10, 2023 at 01:34:16PM +0000, Matthew Wilcox wrote: > > > Exactly. And as I already pointed out in reply to Dave's original > > > patch what we really should be doing is retu

Re: [Cluster-devel] [RFC v6 04/10] iomap: Add iomap_get_folio helper

2023-01-10 Thread Matthew Wilcox
On Tue, Jan 10, 2023 at 12:46:45AM -0800, Christoph Hellwig wrote: > On Mon, Jan 09, 2023 at 01:46:42PM +0100, Andreas Gruenbacher wrote: > > We can handle that by adding a new IOMAP_NOCREATE iterator flag and > > checking for that in iomap_get_folio(). Your patch then turns into > > the below. >

Re: [Cluster-devel] [PATCH v5 7/9] iomap/xfs: Eliminate the iomap_valid handler

2023-01-04 Thread Matthew Wilcox
On Wed, Jan 04, 2023 at 09:53:17AM -0800, Darrick J. Wong wrote: > I wonder if this should be reworked a bit to reduce indenting: > > if (PTR_ERR(folio) == -ESTALE) { FYI this is a bad habit to be in. The compiler can optimise if (folio == ERR_PTR(-ESTALE)) better than it can

Re: [Cluster-devel] [RFC v3 4/7] iomap: Add iomap_folio_prepare helper

2022-12-25 Thread Matthew Wilcox
On Fri, Dec 23, 2022 at 11:23:34PM -0800, Christoph Hellwig wrote: > On Fri, Dec 23, 2022 at 10:05:05PM +0100, Andreas Grünbacher wrote: > > > I'd name this __iomap_get_folio to match __filemap_get_folio. > > > > I was looking at it from the filesystem point of view: this helper is > > meant to

Re: [Cluster-devel] [RFC v3 5/7] iomap: Get page in page_prepare handler

2022-12-16 Thread Matthew Wilcox
On Fri, Dec 16, 2022 at 04:06:24PM +0100, Andreas Gruenbacher wrote: > + if (page_ops && page_ops->page_prepare) > + folio = page_ops->page_prepare(iter, pos, len); > + else > + folio = iomap_folio_prepare(iter, pos); > + if (IS_ERR_OR_NULL(folio)) { > +

Re: [Cluster-devel] BUG: unable to handle kernel NULL pointer dereference in gfs2_evict_inode

2022-11-21 Thread Matthew Wilcox
On Fri, Nov 18, 2022 at 10:33:21AM +0100, Dmitry Vyukov wrote: > On Fri, 18 Nov 2022 at 09:06, Wei Chen wrote: > > > > Dear Linux developers, > > > > The bug persists in upstream Linux v6.0-rc5. > > If you fix this, please also add the syzbot tag: > > Reported-by:

Re: [Cluster-devel] [PATCH] filelock: move file locking definitions to separate header file

2022-11-21 Thread Matthew Wilcox
On Sun, Nov 20, 2022 at 03:59:57PM -0500, Jeff Layton wrote: > Move the file locking definitions to a new header file, and add the > appropriate #include directives to the source files that need them. By > doing this we trim down fs.h a bit and limit the amount of rebuilding > that has to be done

Re: [Cluster-devel] [PATCH] filelock: move file locking definitions to separate header file

2022-11-21 Thread Matthew Wilcox
On Mon, Nov 21, 2022 at 09:26:16AM +0800, Xiubo Li wrote: [1300+ lines snipped] > LGTM. > > Reviewed-by: Xiubo Li You really don't need to quote the whole thing. Please be more considerate.

Re: [Cluster-devel] [PATCH 04/23] page-writeback: Convert write_cache_pages() to use filemap_get_folios_tag()

2022-11-04 Thread Matthew Wilcox
On Fri, Nov 04, 2022 at 11:32:35AM +1100, Dave Chinner wrote: > At minimum, it needs to be documented, though I'd much prefer that > we explicitly duplicate write_cache_pages() as write_cache_folios() > with a callback that takes a folio and change the code to be fully > multi-page folio safe.

Re: [Cluster-devel] [PATCH 04/23] page-writeback: Convert write_cache_pages() to use filemap_get_folios_tag()

2022-11-04 Thread Matthew Wilcox
On Wed, Oct 19, 2022 at 08:01:52AM +1100, Dave Chinner wrote: > On Thu, Sep 01, 2022 at 03:01:19PM -0700, Vishal Moola (Oracle) wrote: > > @@ -2313,17 +2313,18 @@ int write_cache_pages(struct address_space *mapping, > > while (!done && (index <= end)) { > > int i; > > > > -

Re: [Cluster-devel] [PATCH v3 04/23] page-writeback: Convert write_cache_pages() to use filemap_get_folios_tag()

2022-10-24 Thread Matthew Wilcox
upport for large folios to this function. > Signed-off-by: Vishal Moola (Oracle) Reviewed-by: Matthew Wilcox (Oracle)

Re: [Cluster-devel] [PATCH v3 03/23] filemap: Convert __filemap_fdatawait_range() to use filemap_get_folios_tag()

2022-10-24 Thread Matthew Wilcox
ly say that it removes 50 bytes of text and two calls to compound_head(). And that way, this patch justifies its existance by itself ;-) > Signed-off-by: Vishal Moola (Oracle) Reviewed-by: Matthew Wilcox (Oracle)

Re: [Cluster-devel] [PATCH v3 01/23] pagemap: Add filemap_grab_folio()

2022-10-24 Thread Matthew Wilcox
es_range_tag(). I'm still not loving the name, but it does have historical precedent and I can't think of a better one. Reviewed-by: Matthew Wilcox (Oracle)

Re: [Cluster-devel] [PATCH v3 02/23] filemap: Added filemap_get_folios_tag()

2022-10-24 Thread Matthew Wilcox
On Mon, Oct 17, 2022 at 01:24:30PM -0700, Vishal Moola (Oracle) wrote: > This is the equivalent of find_get_pages_range_tag(), except for folios > instead of pages. > > One noteable difference is filemap_get_folios_tag() does not take in a > maximum pages argument. It instead tries to fill a

Re: [Cluster-devel] remove iomap_writepage v2

2022-08-10 Thread Matthew Wilcox
On Wed, Aug 10, 2022 at 11:32:06PM +0200, Andreas Grünbacher wrote: > Am Mi., 10. Aug. 2022 um 22:57 Uhr schrieb Matthew Wilcox > : > > On Mon, Aug 01, 2022 at 11:31:50AM -0400, Johannes Weiner wrote: > > > XFS hasn't had a ->writepage call for a while. After LSF I

Re: [Cluster-devel] remove iomap_writepage v2

2022-08-10 Thread Matthew Wilcox
On Mon, Aug 01, 2022 at 11:31:50AM -0400, Johannes Weiner wrote: > XFS hasn't had a ->writepage call for a while. After LSF I internally > tested dropping btrfs' callback, and the results looked good: no OOM > kills with dirty/writeback pages remaining, performance parity. Then I > went on

Re: [Cluster-devel] remove iomap_writepage v2

2022-07-28 Thread Matthew Wilcox
On Thu, Jul 28, 2022 at 01:10:16PM +0200, Jan Kara wrote: > Hi Christoph! > > On Tue 19-07-22 06:13:07, Christoph Hellwig wrote: > > this series removes iomap_writepage and it's callers, following what xfs > > has been doing for a long time. > > So this effectively means "no writeback from page

Re: [Cluster-devel] [PATCH v2 07/19] mm/migrate: Convert expected_page_refs() to folio_expected_refs()

2022-07-07 Thread Matthew Wilcox
On Thu, Jul 07, 2022 at 07:50:17PM -0700, Hugh Dickins wrote: > On Wed, 8 Jun 2022, Matthew Wilcox (Oracle) wrote: > > > Now that both callers have a folio, convert this function to > > take a folio & rename it. > > > > Signed-off-by: Matthew Wilcox (Oracle)

Re: [Cluster-devel] gfs2 is unhappy on pagecache/for-next

2022-06-19 Thread Matthew Wilcox
On Sun, Jun 19, 2022 at 09:05:59AM +0200, Christoph Hellwig wrote: > When trying to run xfstests on gfs2 (locally with the lock_nolock > cluster managed) the first mount already hits this warning in > inode_to_wb called from mark_buffer_dirty. This all seems standard > code from

Re: [Cluster-devel] [PATCH v2 12/19] btrfs: Convert btrfs_migratepage to migrate_folio

2022-06-09 Thread Matthew Wilcox
On Thu, Jun 09, 2022 at 06:33:23PM +0200, David Sterba wrote: > On Wed, Jun 08, 2022 at 04:02:42PM +0100, Matthew Wilcox (Oracle) wrote: > > Use filemap_migrate_folio() to do the bulk of the work, and then copy > > the ordered flag across if needed. > > > > Signed-off

Re: [Cluster-devel] [PATCH v2 03/19] fs: Add aops->migrate_folio

2022-06-09 Thread Matthew Wilcox
On Thu, Jun 09, 2022 at 02:50:20PM +0200, David Hildenbrand wrote: > On 08.06.22 17:02, Matthew Wilcox (Oracle) wrote: > > diff --git a/Documentation/filesystems/locking.rst > > b/Documentation/filesystems/locking.rst > > index c0fe711f14d3..3d28b23676bd 100644 > > ---

[Cluster-devel] [PATCH v2 15/19] aio: Convert to migrate_folio

2022-06-08 Thread Matthew Wilcox (Oracle)
Use a folio throughout this function. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/aio.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index 3c249b938632..a1911e86859c 100644

[Cluster-devel] [PATCH v2 04/19] mm/migrate: Convert fallback_migrate_page() to fallback_migrate_folio()

2022-06-08 Thread Matthew Wilcox (Oracle)
Use a folio throughout. migrate_page() will be converted to migrate_folio() later. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- mm/migrate.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index

[Cluster-devel] [PATCH v2 13/19] ubifs: Convert to filemap_migrate_folio()

2022-06-08 Thread Matthew Wilcox (Oracle)
filemap_migrate_folio() is a little more general than ubifs really needs, but it's better to share the code. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ubifs/file.c | 29 ++--- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/fs/ubifs/file.c b/fs/ubifs

[Cluster-devel] [PATCH v2 01/19] secretmem: Remove isolate_page

2022-06-08 Thread Matthew Wilcox (Oracle)
The isolate_page operation is never called for filesystems, only for device drivers which call SetPageMovable. Signed-off-by: Matthew Wilcox (Oracle) --- mm/secretmem.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/mm/secretmem.c b/mm/secretmem.c index 206ed6b40c1d..1c7f1775b56e

[Cluster-devel] [PATCH v2 18/19] fs: Remove aops->migratepage()

2022-06-08 Thread Matthew Wilcox (Oracle)
With all users converted to migrate_folio(), remove this operation. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- include/linux/fs.h | 2 -- mm/compaction.c| 5 ++--- mm/migrate.c | 3 --- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git

[Cluster-devel] [PATCH v2 06/19] mm/migrate: Convert buffer_migrate_page() to buffer_migrate_folio()

2022-06-08 Thread Matthew Wilcox (Oracle)
Use a folio throughout __buffer_migrate_folio(), add kernel-doc for buffer_migrate_folio() and buffer_migrate_folio_norefs(), move their declarations to buffer.h and switch all filesystems that have wired them up. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- block

[Cluster-devel] [PATCH v2 02/19] mm: Convert all PageMovable users to movable_operations

2022-06-08 Thread Matthew Wilcox (Oracle)
These drivers are rather uncomfortably hammered into the address_space_operations hole. They aren't filesystems and don't behave like filesystems. They just need their own movable_operations structure, which we can point to directly from page->mapping. Signed-off-by: Matthew Wilcox (Ora

[Cluster-devel] [PATCH v2 17/19] secretmem: Convert to migrate_folio

2022-06-08 Thread Matthew Wilcox (Oracle)
This is little more than changing the types over; there's no real work being done in this function. Signed-off-by: Matthew Wilcox (Oracle) --- mm/secretmem.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/secretmem.c b/mm/secretmem.c index 1c7f1775b56e

[Cluster-devel] [PATCH v2 09/19] nfs: Convert to migrate_folio

2022-06-08 Thread Matthew Wilcox (Oracle)
Use a folio throughout this function. migrate_page() will be converted later. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Anna Schumaker Reviewed-by: Christoph Hellwig --- fs/nfs/file.c | 4 +--- fs/nfs/internal.h | 6 -- fs/nfs/write.c| 16 3 files

[Cluster-devel] [PATCH v2 19/19] mm/folio-compat: Remove migration compatibility functions

2022-06-08 Thread Matthew Wilcox (Oracle)
migrate_page_move_mapping(), migrate_page_copy() and migrate_page_states() are all now unused after converting all the filesystems from aops->migratepage() to aops->migrate_folio(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- include/linux/migrate.

[Cluster-devel] [PATCH v2 05/19] mm/migrate: Convert writeout() to take a folio

2022-06-08 Thread Matthew Wilcox (Oracle)
Use a folio throughout this function. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- mm/migrate.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 1878de817a01..6b6fec26f4d0 100644 --- a/mm

[Cluster-devel] [PATCH v2 03/19] fs: Add aops->migrate_folio

2022-06-08 Thread Matthew Wilcox (Oracle)
Provide a folio-based replacement for aops->migratepage. Update the documentation to document migrate_folio instead of migratepage. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- Documentation/filesystems/locking.rst | 5 ++-- Documentation/filesystems/vfs.

  1   2   3   4   5   >