Re: [PATCH for-4.19 1/2] xarray: Replace exceptional entries

2019-02-25 Thread Matthew Wilcox
On Tue, Feb 26, 2019 at 01:58:08AM +0800, Gao Xiang wrote: > +/** > + * xa_tag_pointer() - Create an XArray entry for a tagged pointer. > + * @p: Plain pointer. > + * @tag: Tag value (0, 1 or 3). > + * > + * If the user of the XArray prefers, they can tag their pointers instead > + * of storing

Re: [PATCH for-4.19 06/12] staging: erofs: fix race when the managed cache is enabled

2019-02-25 Thread Matthew Wilcox
On Mon, Feb 25, 2019 at 04:04:49PM +0100, Greg Kroah-Hartman wrote: > On Wed, Feb 20, 2019 at 05:18:48PM +0800, Gao Xiang wrote: > > commit 51232df5e4b268936beccde5248f312a316800be upstream. > > Updates: > > include/linux/xarray.h: > > add

Re: [PATCH for-4.19 06/12] staging: erofs: fix race when the managed cache is enabled

2019-02-25 Thread Matthew Wilcox
On Mon, Feb 25, 2019 at 04:52:43PM +0100, Greg Kroah-Hartman wrote: > On Mon, Feb 25, 2019 at 07:25:48AM -0800, Matthew Wilcox wrote: > > Putting in all of 3159f943aafdbacb2f94c38fdaadabf2bbde2a14 would be a > > bad idea; it actually ended up breaking m68k in a rather unexpecte

Re: [PATCH v2 for-4.19 RESEND 2/2] staging: erofs: fix race when the managed cache is enabled

2019-03-17 Thread Matthew Wilcox
On Mon, Mar 18, 2019 at 09:59:19AM +0800, Gao Xiang wrote: > ping? > > Hi Greg, > I have no idea of this patch since Matthew makes no response after > modification... And this series is still not backported to 4.19 till now... > > What should I do next? Can this series be accepted for

Re: [PATCH v3 RESEND] staging: erofs: fix an error handling in erofs_readdir()

2019-08-18 Thread Matthew Wilcox
On Sun, Aug 18, 2019 at 11:21:11AM +0800, Gao Xiang wrote: > + if (dentry_page == ERR_PTR(-ENOMEM)) { > + errln("no memory to readdir of logical block %u of nid > %llu", > + i, EROFS_V(dir)->nid); I don't think you need the error message.

Re: [PATCH v2] staging: erofs: fix an error handling in erofs_readdir()

2019-08-17 Thread Matthew Wilcox
On Sun, Aug 18, 2019 at 09:56:31AM +0800, Gao Xiang wrote: > @@ -82,8 +82,12 @@ static int erofs_readdir(struct file *f, struct > dir_context *ctx) > unsigned int nameoff, maxsize; > > dentry_page = read_mapping_page(mapping, i, NULL); > - if

Re: [PATCH v2] staging: erofs: fix an error handling in erofs_readdir()

2019-08-17 Thread Matthew Wilcox
On Sun, Aug 18, 2019 at 10:32:45AM +0800, Gao Xiang wrote: > On Sat, Aug 17, 2019 at 07:20:55PM -0700, Matthew Wilcox wrote: > > On Sun, Aug 18, 2019 at 09:56:31AM +0800, Gao Xiang wrote: > > > @@ -82,8 +82,12 @@ static int erofs_readdir(struct file *f, struct >

Re: [PATCH 10/13] iomap: use a function pointer for dio submits

2019-08-09 Thread Matthew Wilcox
On Wed, Aug 07, 2019 at 10:49:36PM -0700, Eric Biggers wrote: > On Thu, Aug 08, 2019 at 12:26:42PM +0800, Gao Xiang wrote: > > 1. decrypt->verity->decompress > > > > 2. verity->decompress->decrypt > > > > 3. decompress->decrypt->verity > > > >1. and 2. could cause less

Re: [bug report] staging: erofs: tidy up decompression frontend

2019-11-14 Thread Matthew Wilcox
On Thu, Nov 14, 2019 at 10:10:03PM +0300, Dan Carpenter wrote: > fs/erofs/zdata.c:443 z_erofs_register_collection() > error: double unlocked 'cl->lock' (orig line 439) > > fs/erofs/zdata.c >432 cl = z_erofs_primarycollection(pcl); >433 cl->pageofs = map->m_la

Re: [PATCH 00/12] Change readahead API

2020-02-13 Thread Matthew Wilcox
On Wed, Feb 12, 2020 at 08:38:52PM -0800, Andrew Morton wrote: > On Fri, 24 Jan 2020 17:35:41 -0800 Matthew Wilcox wrote: > > > From: "Matthew Wilcox (Oracle)" > > > > This series adds a readahead address_space operation to eventually > > replace the

[PATCH v5 01/13] mm: Fix the return type of __do_page_cache_readahead

2020-02-10 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" ra_submit() which is a wrapper around __do_page_cache_readahead() already returns an unsigned long, and the 'nr_to_read' parameter is an unsigned long, so fix __do_page_cache_readahead() to return an unsigned long, even though I'm pretty sure we're

[PATCH v5 05/13] mm: Add page_cache_readahead_limit

2020-02-10 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) --- fs/ext4/verity.c

[PATCH v5 11/13] f2fs: Convert from readpages to readahead

2020-02-10 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

[PATCH v5 06/13] fs: Convert mpage_readpages to mpage_readahead

2020-02-10 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 (Ora

[PATCH v5 07/13] btrfs: Convert from readpages to readahead

2020-02-10 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| 48 ++--- fs/btrfs/e

[PATCH v5 08/13] erofs: Convert uncompressed files from readpages to readahead

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

[PATCH v5 10/13] ext4: Convert from readpages to readahead

2020-02-10 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| 23 ++- fs/ext4/readpage.c | 22 -- 3 files changed, 19 insertions(+), 29

[PATCH v5 03/13] mm: Put readahead pages in cache earlier

2020-02-10 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" At allocation time, put the pages in the cache unless we're using ->readpages. Signed-off-by: Matthew Wilcox (Oracle) --- mm/readahead.c | 66 -- 1 file changed, 42 insertions(+), 24 deletions(-) di

[PATCH v5 13/13] iomap: Convert from readpages to readahead

2020-02-10 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 | 101 - fs/iomap/trace.h | 2 +- fs/xfs/xfs_aops.c

[PATCH v5 09/13] erofs: Convert compressed files from readpages to readahead

2020-02-10 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs. Signed-off-by: Matthew Wilcox (Oracle) --- fs/erofs/zdata.c | 29 + 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 17

[PATCH v5 00/13] Change readahead API

2020-02-10 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

[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(-)

[PATCH v8 17/25] btrfs: Convert from readpages to readahead

2020-02-25 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Implement the new readahead method in btrfs. Add a readahead_page_batch() to optimise fetching a batch of pages at once. Signed-off-by: Matthew Wilcox (Oracle) --- fs/btrfs/extent_io.c | 46 ++-- fs/btrfs/e

[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

[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

[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

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

[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

[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

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

[PATCH v8 12/25] mm: Move end_index check out of readahead loop

2020-02-25 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 --- mm/readahead.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/mm/r

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

Re: [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: [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: [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: [PATCH 07/12] erofs: Convert uncompressed files from readpages to readahead

2020-01-25 Thread Matthew Wilcox
On Sat, Jan 25, 2020 at 09:53:29AM +0800, Gao Xiang wrote: > > + /* all the page errors are ignored when readahead */ > > + if (IS_ERR(bio)) { > > + pr_err("%s, readahead error at page %lu of nid %llu\n", > > + __func__, page->index, >

Re: [PATCH 03/12] readahead: Put pages in cache earlier

2020-01-25 Thread Matthew Wilcox
On Fri, Jan 24, 2020 at 05:35:44PM -0800, Matthew Wilcox wrote: > @@ -192,8 +194,18 @@ unsigned long __do_page_cache_readahead(struct > address_space *mapping, > page = __page_cache_alloc(gfp_mask); > if (!page) > break; >

Re: [PATCH 04/12] mm: Add readahead address space operation

2020-01-30 Thread Matthew Wilcox
On Wed, Jan 29, 2020 at 11:24:56AM +1100, Dave Chinner wrote: > On Fri, Jan 24, 2020 at 05:35:45PM -0800, Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > > > This replaces ->readpages with a saner interface: > > - Return the number of pa

Re: [PATCH 07/12] erofs: Convert uncompressed files from readpages to readahead

2020-01-30 Thread Matthew Wilcox
On Wed, Jan 29, 2020 at 11:57:41AM +1100, Dave Chinner wrote: > > + bio = NULL; > > + put_page(page); > > } > > > > - /* pages could still be locked */ > > put_page(page); > > A double put_page() on error? Yup, already fixed

Re: [PATCH v4 00/12] Change readahead API

2020-02-04 Thread Matthew Wilcox
On Tue, Feb 04, 2020 at 04:32:27PM +0100, David Sterba wrote: > On Sat, Feb 01, 2020 at 07:12:28AM -0800, Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > > > I would particularly value feedback on this from the gfs2 and ocfs2 > > mainta

[PATCH v4 07/12] erofs: Convert uncompressed files from readpages to readahead

2020-02-01 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs Signed-off-by: Matthew Wilcox (Oracle) Cc: linux-erofs@lists.ozlabs.org --- fs/erofs/data.c | 33 + fs/erofs/zdata.c | 2 +- include/trace/events/er

[PATCH v4 08/12] erofs: Convert compressed files from readpages to readahead

2020-02-01 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs. Signed-off-by: Matthew Wilcox (Oracle) Cc: linux-erofs@lists.ozlabs.org --- fs/erofs/zdata.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/fs/erofs/zdata.c b/fs/ero

[PATCH v4 00/12] Change readahead API

2020-02-01 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" I would particularly value feedback on this from the gfs2 and ocfs2 maintainers. They have non-trivial changes, and a review on patch 5 would be greatly appreciated. This series adds a readahead address_space operation to eventually replace the

[PATCH v4 04/12] mm: Add readahead address space operation

2020-02-01 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This replaces ->readpages with a saner interface: - Return the number of pages not read instead of an ignored error code. - Pages are already in the page cache when ->readahead is called. - Implementation looks up the pages in the pa

[PATCH v4 03/12] readahead: Put pages in cache earlier

2020-02-01 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" At allocation time, put the pages in the cache unless we're using ->readpages. Signed-off-by: Matthew Wilcox (Oracle) Cc: linux-bt...@vger.kernel.org Cc: linux-erofs@lists.ozlabs.org Cc: linux-e...@vger.kernel.org Cc: linux-f2fs-de...@lists.sourc

Re: [PATCH 04/12] mm: Add readahead address space operation

2020-01-31 Thread Matthew Wilcox
On Fri, Jan 24, 2020 at 07:57:40PM -0800, Randy Dunlap wrote: > > +``readahead`` > > + called by the VM to read pages associated with the address_space > > + object. The pages are consecutive in the page cache and are > > +locked. The implementation should decrement the page refcount

[PATCH 08/12] erofs: Convert compressed files from readpages to readahead

2020-01-24 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs. Signed-off-by: Matthew Wilcox (Oracle) Cc: linux-erofs@lists.ozlabs.org --- fs/erofs/zdata.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/fs/erofs/zdata.c b/fs/ero

[PATCH 03/12] readahead: Put pages in cache earlier

2020-01-24 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" At allocation time, put the pages in the cache unless we're using ->readpages. Signed-off-by: Matthew Wilcox (Oracle) Cc: linux-bt...@vger.kernel.org Cc: linux-erofs@lists.ozlabs.org Cc: linux-e...@vger.kernel.org Cc: linux-f2fs-de...@lists.sourc

[PATCH 04/12] mm: Add readahead address space operation

2020-01-24 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This replaces ->readpages with a saner interface: - Return the number of pages not read instead of an ignored error code. - Pages are already in the page cache when ->readahead is called. - Implementation looks up the pages in the pa

[PATCH 07/12] erofs: Convert uncompressed files from readpages to readahead

2020-01-24 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs. Fix what I believe to be a refcounting bug in the error case. Signed-off-by: Matthew Wilcox (Oracle) Cc: linux-erofs@lists.ozlabs.org --- fs/erofs/data.c | 34 ++

[PATCH v6 18/19] iomap: Convert from readpages to readahead

2020-02-17 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 | 91 +++--- fs/iomap/trace.h | 2 +- fs/xfs/xfs_aops.c

[PATCH v6 16/16] mm: Use memalloc_nofs_save in readahead path

2020-02-17 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

[PATCH v6 15/16] iomap: Convert from readpages to readahead

2020-02-17 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 | 116 - fs/iomap/trace.h | 2 +- fs/xfs/xfs_aops.c

[PATCH v6 12/19] erofs: Convert uncompressed files from readpages to readahead

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

[PATCH v6 17/19] iomap: Restructure iomap_readpages_actor

2020-02-17 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

[PATCH v6 04/19] mm: Rearrange readahead loop

2020-02-17 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Move the declaration of 'page' to inside the loop and move the 'kick off a fresh batch' code to the end of the function for easier use in subsequent patches. Signed-off-by: Matthew Wilcox (Oracle) --- mm/readahead.c | 21 + 1 fi

[PATCH v6 10/19] fs: Convert mpage_readpages to mpage_readahead

2020-02-17 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

[PATCH v6 08/19] mm: Add readahead address space operation

2020-02-17 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This replaces ->readpages with a saner interface: - Return void instead of an ignored error code. - Pages are already in the page cache when ->readahead is called. - Implementation looks up the pages in the page cache instead of ha

[PATCH v6 13/16] f2fs: Convert from readpages to readahead

2020-02-17 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

[PATCH v6 01/19] mm: Return void from various readahead functions

2020-02-17 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

Re: [PATCH v6 00/19] Change readahead API

2020-02-17 Thread Matthew Wilcox
On Mon, Feb 17, 2020 at 10:45:41AM -0800, Matthew Wilcox wrote: > This series adds a readahead address_space operation to eventually *sigh*. Clearly I forgot to rm -rf an earlier version. Please disregard any patches labelled n/16. I can send a v7 if this is too much hassle.

[PATCH v6 13/19] erofs: Convert compressed files from readpages to readahead

2020-02-17 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs. Signed-off-by: Matthew Wilcox (Oracle) --- fs/erofs/zdata.c | 29 + 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 17

[PATCH v6 05/19] mm: Remove 'page_offset' from readahead loop

2020-02-17 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Eliminate the page_offset variable which was confusing with the 'offset' parameter and record the start of each consecutive run of pages in the readahead_control. Signed-off-by: Matthew Wilcox (Oracle) --- mm/readahead.c | 10 ++ 1 file

[PATCH v6 08/16] fs: Convert mpage_readpages to mpage_readahead

2020-02-17 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

[PATCH v6 19/19] mm: Use memalloc_nofs_save in readahead path

2020-02-17 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

[PATCH v6 16/19] fuse: Convert from readpages to readahead

2020-02-17 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) --- fs/f

[PATCH v6 09/16] btrfs: Convert from readpages to readahead

2020-02-17 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| 48 ++--- fs/btrfs/e

[PATCH v6 14/16] fuse: Convert from readpages to readahead

2020-02-17 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) --- fs/f

[PATCH v6 12/16] ext4: Convert from readpages to readahead

2020-02-17 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| 23 ++- fs/ext4/readpage.c | 22 -- 3 files changed, 19 insertions(+), 29

[PATCH v6 03/19] mm: Use readahead_control to pass arguments

2020-02-17 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. Also add the readahead_count() accessor. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/pagemap.h | 17 +++

[PATCH v6 02/19] mm: Ignore return value of ->readpages

2020-02-17 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 --- mm/readahead.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletion

[PATCH v6 00/19] Change readahead API

2020-02-17 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

[PATCH v6 07/19] mm: Put readahead pages in cache earlier

2020-02-17 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" At allocation time, put the pages in the cache unless we're using ->readpages. Add the readahead_for_each() iterator for the benefit of the ->readpage fallback. This iterator supports huge pages, even though none of the filesystems to be

[PATCH v6 07/16] mm: Add page_cache_readahead_limit

2020-02-17 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) --- fs/ext4/verity.c

[PATCH v6 10/16] erofs: Convert uncompressed files from readpages to readahead

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

[PATCH v6 09/19] mm: Add page_cache_readahead_limit

2020-02-17 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) --- fs/ext4/verity.c

[PATCH v6 06/19] mm: rename readahead loop variable to 'i'

2020-02-17 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) --- mm/readahead.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletion

[PATCH v6 06/16] mm: Add readahead address space operation

2020-02-17 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This replaces ->readpages with a saner interface: - Return void instead of an ignored error code. - Pages are already in the page cache when ->readahead is called. - Implementation looks up the pages in the page cache instead of ha

[PATCH v6 05/16] mm: Put readahead pages in cache earlier

2020-02-17 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" At allocation time, put the pages in the cache unless we're using ->readpages. Add the readahead_for_each() iterator for the benefit of the ->readpage fallback. This iterator supports huge pages, even though none of the filesystems to be

[PATCH v6 15/19] f2fs: Convert from readpages to readahead

2020-02-17 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

[PATCH v6 11/16] erofs: Convert compressed files from readpages to readahead

2020-02-17 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs. Signed-off-by: Matthew Wilcox (Oracle) --- fs/erofs/zdata.c | 29 + 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 17

[PATCH v6 11/19] btrfs: Convert from readpages to readahead

2020-02-17 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

[PATCH v6 04/16] mm: Tweak readahead loop slightly

2020-02-17 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Eliminate the page_offset variable which was just confusing; record the start of each consecutive run of pages in the readahead_control, and move the 'kick off a fresh batch' code to the end of the function for easier use in the next patch. Signed-off-b

[PATCH v6 14/19] ext4: Convert from readpages to readahead

2020-02-17 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| 23 ++- fs/ext4/readpage.c | 22 -- 3 files changed, 19 insertions(+), 29

Re: [PATCH 00/44] Manually convert filesystem FS documents to ReST

2020-02-17 Thread Matthew Wilcox
On Mon, Feb 17, 2020 at 05:11:46PM +0100, Mauro Carvalho Chehab wrote: > There are lots of plain text documents under Documentation/filesystems. > > Manually convert several of those to ReST and add them to the index file. I think at least 90% of this material needs to be in admin-guide. Should

Re: [PATCH v6 01/19] mm: Return void from various readahead functions

2020-02-18 Thread Matthew Wilcox
On Tue, Feb 18, 2020 at 01:05:29PM -0800, John Hubbard wrote: > This is an easy review and obviously correct, so: > > Reviewed-by: John Hubbard Thanks > Thoughts for the future of the API: > > I will add that I could envision another patchset that went in the > opposite direction, and

  1   2   3   >