diff mbox series

netfs: Fault in smaller chunks for non-large folio mappings

Message ID 20240527201735.1898381-1-willy@infradead.org (mailing list archive)
State New
Headers show
Series netfs: Fault in smaller chunks for non-large folio mappings | expand

Commit Message

Matthew Wilcox May 27, 2024, 8:17 p.m. UTC
As in commit 4e527d5841e2 ("iomap: fault in smaller chunks for non-large
folio mappings"), we can see a performance loss for filesystems
which have not yet been converted to large folios.

Fixes: c38f4e96e605 ("netfs: Provide func to copy data to pagecache for buffered write")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/netfs/buffered_write.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Matthew Wilcox July 26, 2024, 5:03 p.m. UTC | #1
On Mon, May 27, 2024 at 09:17:32PM +0100, Matthew Wilcox (Oracle) wrote:
> As in commit 4e527d5841e2 ("iomap: fault in smaller chunks for non-large
> folio mappings"), we can see a performance loss for filesystems
> which have not yet been converted to large folios.

Did this patch get lost?

> Fixes: c38f4e96e605 ("netfs: Provide func to copy data to pagecache for buffered write")
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
>  fs/netfs/buffered_write.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/netfs/buffered_write.c b/fs/netfs/buffered_write.c
> index 07bc1fd43530..3288561e98dd 100644
> --- a/fs/netfs/buffered_write.c
> +++ b/fs/netfs/buffered_write.c
> @@ -184,7 +184,7 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter,
>  	unsigned int bdp_flags = (iocb->ki_flags & IOCB_NOWAIT) ? BDP_ASYNC : 0;
>  	ssize_t written = 0, ret, ret2;
>  	loff_t i_size, pos = iocb->ki_pos, from, to;
> -	size_t max_chunk = PAGE_SIZE << MAX_PAGECACHE_ORDER;
> +	size_t max_chunk = mapping_max_folio_size(mapping);
>  	bool maybe_trouble = false;
>  
>  	if (unlikely(test_bit(NETFS_ICTX_WRITETHROUGH, &ctx->flags) ||
> -- 
> 2.43.0
>
Jeff Layton July 26, 2024, 5:56 p.m. UTC | #2
On Mon, 2024-05-27 at 21:17 +0100, Matthew Wilcox (Oracle) wrote:
> As in commit 4e527d5841e2 ("iomap: fault in smaller chunks for non-
> large
> folio mappings"), we can see a performance loss for filesystems
> which have not yet been converted to large folios.
> 
> Fixes: c38f4e96e605 ("netfs: Provide func to copy data to pagecache
> for buffered write")
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
>  fs/netfs/buffered_write.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/netfs/buffered_write.c b/fs/netfs/buffered_write.c
> index 07bc1fd43530..3288561e98dd 100644
> --- a/fs/netfs/buffered_write.c
> +++ b/fs/netfs/buffered_write.c
> @@ -184,7 +184,7 @@ ssize_t netfs_perform_write(struct kiocb *iocb,
> struct iov_iter *iter,
>  	unsigned int bdp_flags = (iocb->ki_flags & IOCB_NOWAIT) ?
> BDP_ASYNC : 0;
>  	ssize_t written = 0, ret, ret2;
>  	loff_t i_size, pos = iocb->ki_pos, from, to;
> -	size_t max_chunk = PAGE_SIZE << MAX_PAGECACHE_ORDER;
> +	size_t max_chunk = mapping_max_folio_size(mapping);
>  	bool maybe_trouble = false;
>  
>  	if (unlikely(test_bit(NETFS_ICTX_WRITETHROUGH, &ctx->flags)
> ||

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Christian Brauner July 29, 2024, 7:27 a.m. UTC | #3
On Mon, 27 May 2024 21:17:32 +0100, Matthew Wilcox (Oracle) wrote:
> As in commit 4e527d5841e2 ("iomap: fault in smaller chunks for non-large
> folio mappings"), we can see a performance loss for filesystems
> which have not yet been converted to large folios.
> 
> 

Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes

[1/1] netfs: Fault in smaller chunks for non-large folio mappings
      https://git.kernel.org/vfs/vfs/c/9f337b5daac1
diff mbox series

Patch

diff --git a/fs/netfs/buffered_write.c b/fs/netfs/buffered_write.c
index 07bc1fd43530..3288561e98dd 100644
--- a/fs/netfs/buffered_write.c
+++ b/fs/netfs/buffered_write.c
@@ -184,7 +184,7 @@  ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter,
 	unsigned int bdp_flags = (iocb->ki_flags & IOCB_NOWAIT) ? BDP_ASYNC : 0;
 	ssize_t written = 0, ret, ret2;
 	loff_t i_size, pos = iocb->ki_pos, from, to;
-	size_t max_chunk = PAGE_SIZE << MAX_PAGECACHE_ORDER;
+	size_t max_chunk = mapping_max_folio_size(mapping);
 	bool maybe_trouble = false;
 
 	if (unlikely(test_bit(NETFS_ICTX_WRITETHROUGH, &ctx->flags) ||