[Cluster-devel] [PATCH v10 23/25] f2fs: Pass the inode to f2fs_mpage_readpages

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This function now only uses the mapping argument to look up the inode, and both callers already have the inode, so just pass the inode instead of the mapping. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski Reviewed-by: Er

[Cluster-devel] [PATCH v10 11/25] mm: Add readahead address space operation

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This replaces ->readpages with a saner interface: - Return void instead of an ignored error code. - Page cache is already populated with locked pages when ->readahead is called. - New arguments can be passed to the implementation without

[Cluster-devel] [PATCH v10 13/25] mm: Add page_cache_readahead_unbounded

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" ext4 and f2fs have duplicated the guts of the readahead code so they can read past i_size. Instead, separate out the guts of the readahead code so they can call it directly. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig

[Cluster-devel] [PATCH v10 25/25] iomap: Convert from readpages to readahead

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in iomap. Convert XFS and ZoneFS to use it. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: William Kucharski --- fs/iomap/buffered

[Cluster-devel] [PATCH v10 19/25] erofs: Convert compressed files from readpages to readahead

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Gao Xiang Reviewed-by: Dave Chinner Reviewed-by: William Kucharski Reviewed-by: Chao Yu --- fs/erofs/zdata.c | 29 + 1 file

[Cluster-devel] [PATCH v10 21/25] ext4: Pass the inode to ext4_mpage_readpages

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This function now only uses the mapping argument to look up the inode, and both callers already have the inode, so just pass the inode instead of the mapping. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski Reviewed-by: Er

[Cluster-devel] [PATCH v10 07/25] mm: Rename various 'offset' parameters to 'index'

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" The word 'offset' is used ambiguously to mean 'byte offset within a page', 'byte offset from the start of the file' and 'page offset from the start of the file'. Use 'index' to mean 'page offset from the start of the file' throughout the readahead cod

[Cluster-devel] [PATCH v10 06/25] mm: Use readahead_control to pass arguments

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" In this patch, only between __do_page_cache_readahead() and read_pages(), but it will be extended in upcoming patches. The read_pages() function becomes aops centric, as this makes the most sense by the end of the patchset. Signed-off-by: Matthew Wilc

[Cluster-devel] [PATCH v10 12/25] mm: Move end_index check out of readahead loop

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" By reducing nr_to_read, we can eliminate this check from inside the loop. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: John Hubbard Reviewed-by: William Kucharski --- mm/readahead.c | 14 -- 1 file changed, 8 insertions(+), 6

[Cluster-devel] [PATCH v10 24/25] fuse: Convert from readpages to readahead

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in fuse. Switching away from the read_cache_pages() helper gets rid of an implicit call to put_page(), so we can get rid of the get_page() call in fuse_readpages_fill(). Signed-off-by: Matthew Wilcox (Oracle) Reviewe

[Cluster-devel] [PATCH v10 17/25] btrfs: Convert from readpages to readahead

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Implement the new readahead method in btrfs using the new readahead_page_batch() function. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski --- fs/btrfs/extent_io.c | 43 --- fs/btrfs/e

[Cluster-devel] [PATCH v10 03/25] mm: Ignore return value of ->readpages

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" We used to assign the return value to a variable, which we then ignored. Remove the pretence of caring. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Dave Chinner Reviewed-by: John Hubbard Reviewed-by: William

[Cluster-devel] [PATCH v10 18/25] erofs: Convert uncompressed files from readpages to readahead

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Gao Xiang Reviewed-by: William Kucharski Reviewed-by: Chao Yu --- fs/erofs/data.c | 39 +--- fs/ero

[Cluster-devel] [PATCH v10 08/25] mm: rename readahead loop variable to 'i'

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Change the type of page_idx to unsigned long, and rename it -- it's just a loop counter, not a page index. Suggested-by: John Hubbard Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Dave Chinner Reviewed-by: William Kucharski --- mm/reada

[Cluster-devel] [PATCH v10 20/25] ext4: Convert from readpages to readahead

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in ext4 Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski Reviewed-by: Eric Biggers --- fs/ext4/ext4.h | 3 +-- fs/ext4/inode.c| 21 + fs/ext4/readp

[Cluster-devel] [PATCH v10 15/25] mm: Use memalloc_nofs_save in readahead path

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Ensure that memory allocations in the readahead path do not attempt to reclaim file-backed pages, which could lead to a deadlock. It is possible, though unlikely this is the root cause of a problem observed by Cong Wang. Signed-off-by: Matthew Wilc

[Cluster-devel] [PATCH v10 22/25] f2fs: Convert from readpages to readahead

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in f2fs Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski Reviewed-by: Eric Biggers Reviewed-by: Chao Yu Acked-by: Jaegeuk Kim --- fs/f2fs/data.c

[Cluster-devel] [PATCH v10 14/25] mm: Document why we don't set PageReadahead

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" If the page is already in cache, we don't set PageReadahead on it. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski --- mm/readahead.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletion

[Cluster-devel] [PATCH v10 10/25] mm: Put readahead pages in cache earlier

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" When populating the page cache for readahead, mappings that use ->readpages must populate the page cache themselves as the pages are passed on a linked list which would normally be used for the page cache's LRU. For mappings that use ->readpage

[Cluster-devel] [PATCH v10 05/25] mm: Add new readahead_control API

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Filesystems which implement the upcoming ->readahead method will get their pages by calling readahead_page() or readahead_page_batch(). These functions support large pages, even though none of the filesystems to be converted do yet. Signed-off-by: M

[Cluster-devel] [PATCH v10 09/25] mm: Remove 'page_offset' from readahead loop

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Replace the page_offset variable with 'index + i'. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski --- mm/readahead.c | 8 +++- 1 file changed, 3 insertions(+), 5

[Cluster-devel] [PATCH v10 01/25] mm: Move readahead prototypes from mm.h

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" The readahead code is part of the page cache so should be found in the pagemap.h file. force_page_cache_readahead is only used within mm, so move it to mm/internal.h instead. Remove the parameter names where they add no value, and rename the ones

Re: [Cluster-devel] [PATCH v9 12/25] mm: Move end_index check out of readahead loop

2020-03-22 Thread Matthew Wilcox
On Fri, Mar 20, 2020 at 11:24:52AM -0700, Eric Biggers wrote: > On Fri, Mar 20, 2020 at 11:11:32AM -0700, Matthew Wilcox wrote: > > On Fri, Mar 20, 2020 at 11:00:17AM -0700, Eric Biggers wrote: > > > But then if someone passes index=0 and nr_to_read=0, this underflows and >

Re: [Cluster-devel] [PATCH v9 12/25] mm: Move end_index check out of readahead loop

2020-03-20 Thread Matthew Wilcox
On Fri, Mar 20, 2020 at 11:00:17AM -0700, Eric Biggers wrote: > On Fri, Mar 20, 2020 at 10:30:40AM -0700, Matthew Wilcox wrote: > > On Fri, Mar 20, 2020 at 09:58:28AM -0700, Eric Biggers wrote: > > > On Fri, Mar 20, 2020 at 07:22:18AM -0700, Matthew Wilcox wrote: > > >

Re: [Cluster-devel] [PATCH v9 20/25] ext4: Convert from readpages to readahead

2020-03-20 Thread Matthew Wilcox
On Fri, Mar 20, 2020 at 10:37:34AM -0700, Eric Biggers wrote: > On Fri, Mar 20, 2020 at 07:22:26AM -0700, Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > > > Use the new readahead operation in ext4 > > > > Signed-off-by: Matthew Wilcox (

[Cluster-devel] [PATCH v9 00/25] Change readahead API

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This series adds a readahead address_space operation to replace the readpages operation. The key difference is that pages are added to the page cache as they are allocated (and then looked up by the filesystem) instead of passing them on a list to the

[Cluster-devel] [PATCH v9 25/25] iomap: Convert from readpages to readahead

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in iomap. Convert XFS and ZoneFS to use it. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: William Kucharski --- fs/iomap/buffered

[Cluster-devel] [PATCH v9 09/25] mm: Remove 'page_offset' from readahead loop

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Replace the page_offset variable with 'index + i'. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski --- mm/readahead.c | 8 +++- 1 file changed, 3 insertions(+), 5

[Cluster-devel] [PATCH v9 06/25] mm: Use readahead_control to pass arguments

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" In this patch, only between __do_page_cache_readahead() and read_pages(), but it will be extended in upcoming patches. The read_pages() function becomes aops centric, as this makes the most sense by the end of the patchset. Signed-off-by: Matthew Wilc

[Cluster-devel] [PATCH v9 11/25] mm: Add readahead address space operation

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This replaces ->readpages with a saner interface: - Return void instead of an ignored error code. - Page cache is already populated with locked pages when ->readahead is called. - New arguments can be passed to the implementation without

[Cluster-devel] [PATCH v9 04/25] mm: Move readahead nr_pages check into read_pages

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Simplify the callers by moving the check for nr_pages and the BUG_ON into read_pages(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Zi Yan Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski --- mm/r

[Cluster-devel] [PATCH v9 16/25] fs: Convert mpage_readpages to mpage_readahead

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Implement the new readahead aop and convert all callers (block_dev, exfat, ext2, fat, gfs2, hpfs, isofs, jfs, nilfs2, ocfs2, omfs, qnx6, reiserfs & udf). The callers are all trivial except for GFS2 & OCFS2. Signed-off-by: Matthew Wilcox

[Cluster-devel] [PATCH v9 10/25] mm: Put readahead pages in cache earlier

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" When populating the page cache for readahead, mappings that use ->readpages must populate the page cache themselves as the pages are passed on a linked list which would normally be used for the page cache's LRU. For mappings that use ->readpage

[Cluster-devel] [PATCH v9 01/25] mm: Move readahead prototypes from mm.h

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" The readahead code is part of the page cache so should be found in the pagemap.h file. force_page_cache_readahead is only used within mm, so move it to mm/internal.h instead. Remove the parameter names where they add no value, and rename the ones

[Cluster-devel] [PATCH v9 21/25] ext4: Pass the inode to ext4_mpage_readpages

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This function now only uses the mapping argument to look up the inode, and both callers already have the inode, so just pass the inode instead of the mapping. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski --- fs/ext4/ext4

[Cluster-devel] [PATCH v9 20/25] ext4: Convert from readpages to readahead

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in ext4 Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski --- fs/ext4/ext4.h | 3 +-- fs/ext4/inode.c| 21 + fs/ext4/readpage.c | 22 -- 3 files c

[Cluster-devel] [PATCH v9 02/25] mm: Return void from various readahead functions

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" ondemand_readahead has two callers, neither of which use the return value. That means that both ra_submit and __do_page_cache_readahead() can return void, and we don't need to worry that a present page in the readahead window causes us to return a smalle

[Cluster-devel] [PATCH v9 03/25] mm: Ignore return value of ->readpages

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" We used to assign the return value to a variable, which we then ignored. Remove the pretence of caring. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Dave Chinner Reviewed-by: John Hubbard Reviewed-by: William

[Cluster-devel] [PATCH v9 13/25] mm: Add page_cache_readahead_unbounded

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" ext4 and f2fs have duplicated the guts of the readahead code so they can read past i_size. Instead, separate out the guts of the readahead code so they can call it directly. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig

[Cluster-devel] [PATCH v9 14/25] mm: Document why we don't set PageReadahead

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" If the page is already in cache, we don't set PageReadahead on it. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski --- mm/readahead.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletion

[Cluster-devel] [PATCH v9 22/25] f2fs: Convert from readpages to readahead

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in f2fs Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski --- fs/f2fs/data.c | 47 +++-- include/trace/events/f2fs.h | 6 ++--- 2 files changed, 22

[Cluster-devel] [PATCH v9 08/25] mm: rename readahead loop variable to 'i'

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Change the type of page_idx to unsigned long, and rename it -- it's just a loop counter, not a page index. Suggested-by: John Hubbard Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Dave Chinner Reviewed-by: William Kucharski --- mm/reada

[Cluster-devel] [PATCH v9 18/25] erofs: Convert uncompressed files from readpages to readahead

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Gao Xiang Reviewed-by: William Kucharski --- fs/erofs/data.c | 39 +--- fs/erofs/zdata.c | 2 +- inc

[Cluster-devel] [PATCH v9 07/25] mm: Rename various 'offset' parameters to 'index'

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" The word 'offset' is used ambiguously to mean 'byte offset within a page', 'byte offset from the start of the file' and 'page offset from the start of the file'. Use 'index' to mean 'page offset from the start of the file' throughout the readahead cod

[Cluster-devel] [PATCH v9 23/25] f2fs: Pass the inode to f2fs_mpage_readpages

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This function now only uses the mapping argument to look up the inode, and both callers already have the inode, so just pass the inode instead of the mapping. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski --- fs/f2fs/

[Cluster-devel] [PATCH v9 05/25] mm: Add new readahead_control API

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Filesystems which implement the upcoming ->readahead method will get their pages by calling readahead_page() or readahead_page_batch(). These functions support large pages, even though none of the filesystems to be converted do yet. Signed-off-by: M

[Cluster-devel] [PATCH v9 17/25] btrfs: Convert from readpages to readahead

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Implement the new readahead method in btrfs using the new readahead_page_batch() function. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski --- fs/btrfs/extent_io.c | 46 ++-- fs/btrfs/e

[Cluster-devel] [PATCH v9 12/25] mm: Move end_index check out of readahead loop

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" By reducing nr_to_read, we can eliminate this check from inside the loop. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: John Hubbard Reviewed-by: William Kucharski --- mm/readahead.c | 17 +++-- 1 file changed, 11 insertions(+), 6

[Cluster-devel] [PATCH v9 15/25] mm: Use memalloc_nofs_save in readahead path

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Ensure that memory allocations in the readahead path do not attempt to reclaim file-backed pages, which could lead to a deadlock. It is possible, though unlikely this is the root cause of a problem observed by Cong Wang. Signed-off-by: Matthew Wilc

[Cluster-devel] [PATCH v9 19/25] erofs: Convert compressed files from readpages to readahead

2020-03-20 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Gao Xiang Reviewed-by: Dave Chinner Reviewed-by: William Kucharski --- fs/erofs/zdata.c | 29 + 1 file changed, 9 inserti

Re: [Cluster-devel] [PATCH v8 00/25] Change readahead API

2020-03-19 Thread Matthew Wilcox
On Thu, Mar 19, 2020 at 03:20:38AM -0700, Christoph Hellwig wrote: > Any plans to resend this with the little nitpicks fixed? I'd love to > get this series into 5.7.. The only nitpick I see left is the commit comment in the btrfs patch, and a note from Dave Sterba that he intends to review it.

[Cluster-devel] [PATCH v8 23/25] f2fs: Pass the inode to f2fs_mpage_readpages

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This function now only uses the mapping argument to look up the inode, and both callers already have the inode, so just pass the inode instead of the mapping. Signed-off-by: Matthew Wilcox (Oracle) --- fs/f2fs/data.c | 7 +++ 1 file changed, 3

[Cluster-devel] [PATCH v8 25/25] iomap: Convert from readpages to readahead

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in iomap. Convert XFS and ZoneFS to use it. Signed-off-by: Matthew Wilcox (Oracle) --- fs/iomap/buffered-io.c | 90 +++--- fs/iomap/trace.h | 2 +- fs/xfs/xfs_aops.c

[Cluster-devel] [PATCH v8 24/25] fuse: Convert from readpages to readahead

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in fuse. Switching away from the read_cache_pages() helper gets rid of an implicit call to put_page(), so we can get rid of the get_page() call in fuse_readpages_fill(). Signed-off-by: Matthew Wilcox (Oracle) Reviewe

[Cluster-devel] [PATCH v8 22/25] f2fs: Convert from readpages to readahead

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in f2fs Signed-off-by: Matthew Wilcox (Oracle) --- fs/f2fs/data.c | 47 +++-- include/trace/events/f2fs.h | 6 ++--- 2 files changed, 22 insertions(+), 31 deletions(-)

[Cluster-devel] [PATCH v8 10/25] mm: Put readahead pages in cache earlier

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" When populating the page cache for readahead, mappings that use ->readpages must populate the page cache themselves as the pages are passed on a linked list which would normally be used for the page cache's LRU. For mappings that use ->readpage

[Cluster-devel] [PATCH v8 00/25] Change readahead API

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This series adds a readahead address_space operation to replace the readpages operation. The key difference is that pages are added to the page cache as they are allocated (and then looked up by the filesystem) instead of passing them on a list to the

[Cluster-devel] [PATCH v8 19/25] erofs: Convert compressed files from readpages to readahead

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Gao Xiang Reviewed-by: Dave Chinner --- fs/erofs/zdata.c | 29 + 1 file changed, 9 insertions(+), 20 deletions(-) diff --git

[Cluster-devel] [PATCH v8 01/25] mm: Move readahead prototypes from mm.h

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" The readahead code is part of the page cache so should be found in the pagemap.h file. force_page_cache_readahead is only used within mm, so move it to mm/internal.h instead. Remove the parameter names where they add no value, and rename the ones

[Cluster-devel] [PATCH v8 15/25] mm: Use memalloc_nofs_save in readahead path

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Ensure that memory allocations in the readahead path do not attempt to reclaim file-backed pages, which could lead to a deadlock. It is possible, though unlikely this is the root cause of a problem observed by Cong Wang. Signed-off-by: Matthew Wilc

[Cluster-devel] [PATCH v8 13/25] mm: Add page_cache_readahead_unbounded

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" ext4 and f2fs have duplicated the guts of the readahead code so they can read past i_size. Instead, separate out the guts of the readahead code so they can call it directly. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --

[Cluster-devel] [PATCH v8 14/25] mm: Document why we don't set PageReadahead

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" If the page is already in cache, we don't set PageReadahead on it. Signed-off-by: Matthew Wilcox (Oracle) --- mm/readahead.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mm/readahead.c b/mm/readahead.c index 8e

[Cluster-devel] [PATCH v8 04/25] mm: Move readahead nr_pages check into read_pages

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Simplify the callers by moving the check for nr_pages and the BUG_ON into read_pages(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Zi Yan Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig --- mm/readahead.c | 12 +++- 1 fi

[Cluster-devel] [PATCH v8 03/25] mm: Ignore return value of ->readpages

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" We used to assign the return value to a variable, which we then ignored. Remove the pretence of caring. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Dave Chinner Reviewed-by: John Hubbard --- mm/reada

[Cluster-devel] [PATCH v8 18/25] erofs: Convert uncompressed files from readpages to readahead

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Gao Xiang --- fs/erofs/data.c | 39 +--- fs/erofs/zdata.c | 2 +- include/trace/events/erofs.h | 6

[Cluster-devel] [PATCH v8 11/25] mm: Add readahead address space operation

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This replaces ->readpages with a saner interface: - Return void instead of an ignored error code. - Page cache is already populated with locked pages when ->readahead is called. - New arguments can be passed to the implementation without

[Cluster-devel] [PATCH v8 16/25] fs: Convert mpage_readpages to mpage_readahead

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Implement the new readahead aop and convert all callers (block_dev, exfat, ext2, fat, gfs2, hpfs, isofs, jfs, nilfs2, ocfs2, omfs, qnx6, reiserfs & udf). The callers are all trivial except for GFS2 & OCFS2. Signed-off-by: Matthew Wilcox

[Cluster-devel] [PATCH v8 08/25] mm: rename readahead loop variable to 'i'

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Change the type of page_idx to unsigned long, and rename it -- it's just a loop counter, not a page index. Suggested-by: John Hubbard Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Dave Chinner --- mm/readahead.c | 8 1 file

[Cluster-devel] [PATCH v8 06/25] mm: Use readahead_control to pass arguments

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" In this patch, only between __do_page_cache_readahead() and read_pages(), but it will be extended in upcoming patches. The read_pages() function becomes aops centric, as this makes the most sense by the end of the patchset. Signed-off-by: Matthew Wilc

[Cluster-devel] [PATCH v8 02/25] mm: Return void from various readahead functions

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" ondemand_readahead has two callers, neither of which use the return value. That means that both ra_submit and __do_page_cache_readahead() can return void, and we don't need to worry that a present page in the readahead window causes us to return a smalle

[Cluster-devel] [PATCH v8 05/25] mm: Add new readahead_control API

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Filesystems which implement the upcoming ->readahead method will get their pages by calling readahead_page() or readahead_page_batch(). These functions support large pages, even though none of the filesystems to be converted do yet. Signed-off-by: M

[Cluster-devel] [PATCH v8 09/25] mm: Remove 'page_offset' from readahead loop

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Replace the page_offset variable with 'index + i'. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig --- mm/readahead.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mm/rea

[Cluster-devel] [PATCH v8 21/25] ext4: Pass the inode to ext4_mpage_readpages

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This function now only uses the mapping argument to look up the inode, and both callers already have the inode, so just pass the inode instead of the mapping. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ext4/ext4.h | 2 +- fs/ext4/inode.c|

[Cluster-devel] [PATCH v8 20/25] ext4: Convert from readpages to readahead

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in ext4 Signed-off-by: Matthew Wilcox (Oracle) --- fs/ext4/ext4.h | 3 +-- fs/ext4/inode.c| 21 + fs/ext4/readpage.c | 22 -- 3 files changed, 18 insertions(+), 28

Re: [Cluster-devel] [PATCH v7 21/24] iomap: Restructure iomap_readpages_actor

2020-02-24 Thread Matthew Wilcox
On Mon, Feb 24, 2020 at 02:17:49PM -0800, Christoph Hellwig wrote: > On Thu, Feb 20, 2020 at 08:24:04AM -0800, Matthew Wilcox wrote: > > On Thu, Feb 20, 2020 at 07:47:41AM -0800, Christoph Hellwig wrote: > > > On Wed, Feb 19, 2020 at 01:01:00PM -0800, Matthew Wilcox wrote: >

Re: [Cluster-devel] [PATCH v7 14/24] btrfs: Convert from readpages to readahead

2020-02-24 Thread Matthew Wilcox
On Mon, Feb 24, 2020 at 01:43:47PM -0800, Christoph Hellwig wrote: > On Thu, Feb 20, 2020 at 07:57:27AM -0800, Christoph Hellwig wrote: > > On Thu, Feb 20, 2020 at 07:54:52AM -0800, Matthew Wilcox wrote: > > > On Thu, Feb 20, 2020 at 07:46:58AM -0800, Christoph Hellwig wrote: &

Re: [Cluster-devel] [PATCH v7 22/24] iomap: Convert from readpages to readahead

2020-02-23 Thread Matthew Wilcox
On Fri, Feb 21, 2020 at 05:00:13PM -0800, Darrick J. Wong wrote: > On Thu, Feb 20, 2020 at 08:57:34AM -0800, Matthew Wilcox wrote: > > On Thu, Feb 20, 2020 at 07:49:12AM -0800, Christoph Hellwig wrote: > > +/** > > + * iomap_readahead - Attempt to read pages from a file. &g

Re: [Cluster-devel] [PATCH v7 21/24] iomap: Restructure iomap_readpages_actor

2020-02-21 Thread Matthew Wilcox
On Fri, Feb 21, 2020 at 04:44:25PM -0800, Darrick J. Wong wrote: > On Wed, Feb 19, 2020 at 01:01:00PM -0800, Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > > > By putting the 'have we reached the end of the page' condition at the end > > of

Re: [Cluster-devel] [PATCH v7 22/24] iomap: Convert from readpages to readahead

2020-02-21 Thread Matthew Wilcox
On Fri, Feb 21, 2020 at 05:03:53PM -0800, Darrick J. Wong wrote: > On Wed, Feb 19, 2020 at 01:01:01PM -0800, Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > > > Use the new readahead operation in iomap. Convert XFS and ZoneFS to > > use it. &

Re: [Cluster-devel] [PATCH v7 01/24] mm: Move readahead prototypes from mm.h

2020-02-21 Thread Matthew Wilcox
On Thu, Feb 20, 2020 at 06:43:31PM -0800, John Hubbard wrote: > Yes. But I think these files also need a similar change: > > fs/btrfs/disk-io.c That gets pagemap.h through ctree.h, so I think it's fine. It's already using mapping_set_gfp_mask(), so it already depends on pagemap.h. >

Re: [Cluster-devel] [PATCH v7 11/24] mm: Move end_index check out of readahead loop

2020-02-21 Thread Matthew Wilcox
On Thu, Feb 20, 2020 at 07:50:39PM -0800, John Hubbard wrote: > This tiny patch made me pause, because I wasn't sure at first of the exact > intent of the lines above. Once I worked it out, it seemed like it might > be helpful (or overkill??) to add a few hints for the reader, especially since >

Re: [Cluster-devel] [PATCH v7 09/24] mm: Put readahead pages in cache earlier

2020-02-20 Thread Matthew Wilcox
On Thu, Feb 20, 2020 at 07:19:58PM -0800, John Hubbard wrote: > > +static inline struct page *readahead_page(struct readahead_control *rac) > > +{ > > + struct page *page; > > + > > + BUG_ON(rac->_batch_count > rac->_nr_pages); > > + rac->_nr_pages -= rac->_batch_count; > > + rac->_index

Re: [Cluster-devel] [PATCH v7 00/23] Change readahead API

2020-02-20 Thread Matthew Wilcox
On Thu, Feb 20, 2020 at 06:54:00PM +0100, David Sterba wrote: > On Wed, Feb 19, 2020 at 01:00:39PM -0800, Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > > > This series adds a readahead address_space operation to eventually > > replace the rea

Re: [Cluster-devel] [PATCH v7 22/24] iomap: Convert from readpages to readahead

2020-02-20 Thread Matthew Wilcox
On Thu, Feb 20, 2020 at 07:49:12AM -0800, Christoph Hellwig wrote: > > +/** > > + * iomap_readahead - Attempt to read pages from a file. > > + * @rac: Describes the pages to be read. > > + * @ops: The operations vector for the filesystem. > > + * > > + * This function is for filesystems to call to

Re: [Cluster-devel] [PATCH v7 21/24] iomap: Restructure iomap_readpages_actor

2020-02-20 Thread Matthew Wilcox
On Thu, Feb 20, 2020 at 07:47:41AM -0800, Christoph Hellwig wrote: > On Wed, Feb 19, 2020 at 01:01:00PM -0800, Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > > > By putting the 'have we reached the end of the page' condition at the end > > of

Re: [Cluster-devel] [PATCH v7 14/24] btrfs: Convert from readpages to readahead

2020-02-20 Thread Matthew Wilcox
On Thu, Feb 20, 2020 at 07:46:58AM -0800, Christoph Hellwig wrote: > On Thu, Feb 20, 2020 at 05:48:49AM -0800, Matthew Wilcox wrote: > > btrfs: Convert from readpages to readahead > > > > Implement the new readahead method in btrfs. Add a readahead_page_batch() > > t

Re: [Cluster-devel] [PATCH v7 10/24] mm: Add readahead address space operation

2020-02-20 Thread Matthew Wilcox
On Thu, Feb 20, 2020 at 10:00:30AM -0500, Zi Yan wrote: > > +/* The index of the first page in this readahead block */ > > +static inline unsigned int readahead_index(struct readahead_control *rac) > > +{ > > + return rac->_index; > > +} > > rac->_index is pgoff_t, so readahead_index() should

Re: [Cluster-devel] [PATCH v7 14/24] btrfs: Convert from readpages to readahead

2020-02-20 Thread Matthew Wilcox
On Thu, Feb 20, 2020 at 09:42:19AM +, Johannes Thumshirn wrote: > On 19/02/2020 22:03, Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > > > Use the new readahead operation in btrfs. Add a > > readahead_for_each_batch() iterator to optimise t

[Cluster-devel] [PATCH v7 01/24] mm: Move readahead prototypes from mm.h

2020-02-19 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" The readahead code is part of the page cache so should be found in the pagemap.h file. force_page_cache_readahead is only used within mm, so move it to mm/internal.h instead. Remove the parameter names where they add no value, and rename the ones

[Cluster-devel] [PATCH v7 19/24] f2fs: Convert from readpages to readahead

2020-02-19 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in f2fs Signed-off-by: Matthew Wilcox (Oracle) --- fs/f2fs/data.c | 50 +++-- fs/f2fs/f2fs.h | 5 ++-- include/trace/events/f2fs.h | 6 ++--- 3 files c

[Cluster-devel] [PATCH v7 21/24] iomap: Restructure iomap_readpages_actor

2020-02-19 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" By putting the 'have we reached the end of the page' condition at the end of the loop instead of the beginning, we can remove the 'submit the last page' code from iomap_readpages(). Also check that iomap_readpage_actor() didn't return 0, which

[Cluster-devel] [PATCH v7 06/24] mm: Rename various 'offset' parameters to 'index'

2020-02-19 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" The word 'offset' is used ambiguously to mean 'byte offset within a page', 'byte offset from the start of the file' and 'page offset from the start of the file'. Use 'index' to mean 'page offset from the start of the file' throughout the readahead cod

[Cluster-devel] [PATCH v7 10/24] mm: Add readahead address space operation

2020-02-19 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This replaces ->readpages with a saner interface: - Return void instead of an ignored error code. - Page cache is already populated with locked pages when ->readahead is called. - New arguments can be passed to the implementation without

[Cluster-devel] [PATCH v7 14/24] btrfs: Convert from readpages to readahead

2020-02-19 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in btrfs. Add a readahead_for_each_batch() iterator to optimise the loop in the XArray. Signed-off-by: Matthew Wilcox (Oracle) --- fs/btrfs/extent_io.c| 46 + fs/btrfs/e

[Cluster-devel] [PATCH v7 20/24] fuse: Convert from readpages to readahead

2020-02-19 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in fuse. Switching away from the read_cache_pages() helper gets rid of an implicit call to put_page(), so we can get rid of the get_page() call in fuse_readpages_fill(). Signed-off-by: Matthew Wilcox (Oracle) Reviewe

[Cluster-devel] [PATCH v7 13/24] fs: Convert mpage_readpages to mpage_readahead

2020-02-19 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Implement the new readahead aop and convert all callers (block_dev, exfat, ext2, fat, gfs2, hpfs, isofs, jfs, nilfs2, ocfs2, omfs, qnx6, reiserfs & udf). The callers are all trivial except for GFS2 & OCFS2. Signed-off-by: Matthew Wilcox

[Cluster-devel] [PATCH v7 00/23] Change readahead API

2020-02-19 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This series adds a readahead address_space operation to eventually replace the readpages operation. The key difference is that pages are added to the page cache as they are allocated (and then looked up by the filesystem) instead of passing them

[Cluster-devel] [PATCH v7 22/24] iomap: Convert from readpages to readahead

2020-02-19 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in iomap. Convert XFS and ZoneFS to use it. Signed-off-by: Matthew Wilcox (Oracle) --- fs/iomap/buffered-io.c | 90 +++--- fs/iomap/trace.h | 2 +- fs/xfs/xfs_aops.c

[Cluster-devel] [PATCH v7 04/24] mm: Move readahead nr_pages check into read_pages

2020-02-19 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Simplify the callers by moving the check for nr_pages and the BUG_ON into read_pages(). Signed-off-by: Matthew Wilcox (Oracle) --- mm/readahead.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mm/readahead.c b/mm/r

[Cluster-devel] [PATCH v7 18/24] ext4: Pass the inode to ext4_mpage_readpages

2020-02-19 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This function now only uses the mapping argument to look up the inode, and both callers already have the inode, so just pass the inode instead of the mapping. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ext4/ext4.h | 2 +- fs/ext4/inode.c|

<    1   2   3   4   5   >